@spectrum-web-components/truncated 1.9.0 → 1.9.1-nightly.20251028214328
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 +184 -0
- package/package.json +74 -74
- package/src/truncated.css.dev.js.map +2 -2
- package/src/truncated.css.js.map +2 -2
- package/stories/truncated.stories.js +40 -0
- package/stories/truncated.stories.js.map +7 -0
- package/test/benchmark/basic-test.js +13 -0
- package/{sp-truncated.js.map → test/benchmark/basic-test.js.map} +4 -4
- package/test/truncated.test-vrt.js +5 -0
- package/{sp-truncated.dev.js.map → test/truncated.test-vrt.js.map} +3 -3
- package/test/truncated.test.js +79 -0
- package/test/truncated.test.js.map +7 -0
- package/custom-elements.json +0 -214
- package/sp-truncated.d.ts +0 -17
- package/sp-truncated.dev.js +0 -4
- package/sp-truncated.js +0 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
## 1.9.1-nightly.20251028214328
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @spectrum-web-components/base@1.9.1-nightly.20251028214328
|
|
9
|
+
- @spectrum-web-components/overlay@1.9.1-nightly.20251028214328
|
|
10
|
+
- @spectrum-web-components/tooltip@1.9.1-nightly.20251028214328
|
|
11
|
+
- @spectrum-web-components/styles@1.9.1-nightly.20251028214328
|
|
12
|
+
|
|
13
|
+
## 1.9.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies []:
|
|
18
|
+
- @spectrum-web-components/overlay@1.9.0
|
|
19
|
+
- @spectrum-web-components/tooltip@1.9.0
|
|
20
|
+
- @spectrum-web-components/base@1.9.0
|
|
21
|
+
- @spectrum-web-components/styles@1.9.0
|
|
22
|
+
|
|
23
|
+
## 1.8.0
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`77bdef6`](https://github.com/adobe/spectrum-web-components/commit/77bdef68a40e0f6cd5476271b01b4c0f00531f4f), [`14486d6`](https://github.com/adobe/spectrum-web-components/commit/14486d620e88976c794225edb54eaca8392015c7), [`ee1bae6`](https://github.com/adobe/spectrum-web-components/commit/ee1bae6f9a7401dc31ebc84e4e27f9d39be692d1), [`15be17d`](https://github.com/adobe/spectrum-web-components/commit/15be17db91f1140ccf3cad52b1f2ed6c4b9e28ba), [`14486d6`](https://github.com/adobe/spectrum-web-components/commit/14486d620e88976c794225edb54eaca8392015c7)]:
|
|
28
|
+
- @spectrum-web-components/styles@1.8.0
|
|
29
|
+
- @spectrum-web-components/overlay@1.8.0
|
|
30
|
+
- @spectrum-web-components/tooltip@1.8.0
|
|
31
|
+
- @spectrum-web-components/base@1.8.0
|
|
32
|
+
|
|
33
|
+
## 1.7.0
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [[`1126cf2`](https://github.com/adobe/spectrum-web-components/commit/1126cf22c0076c8728b86e9c0bf7f67fdd8fde07), [`a646ae8`](https://github.com/adobe/spectrum-web-components/commit/a646ae8b0e652308d359226740d2cb189e492e45), [`cde976d`](https://github.com/adobe/spectrum-web-components/commit/cde976ddfa71f898e2d0404ecc53150db149a861)]:
|
|
38
|
+
- @spectrum-web-components/styles@1.7.0
|
|
39
|
+
- @spectrum-web-components/overlay@1.7.0
|
|
40
|
+
- @spectrum-web-components/tooltip@1.7.0
|
|
41
|
+
- @spectrum-web-components/base@1.7.0
|
|
42
|
+
|
|
43
|
+
## 1.6.0
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`700489f`](https://github.com/adobe/spectrum-web-components/commit/700489f87e96b895a687431486fb329c7497f2d6), [`9e15a66`](https://github.com/adobe/spectrum-web-components/commit/9e15a66a281745004add414ff977d4a71186aedd), [`a9727d2`](https://github.com/adobe/spectrum-web-components/commit/a9727d2975b01f440c09789c9e7e0122063b6f7e), [`53f3769`](https://github.com/adobe/spectrum-web-components/commit/53f3769f07b6e7853a8a4c0dc63b21fe14cf3d4b)]:
|
|
48
|
+
- @spectrum-web-components/tooltip@1.6.0
|
|
49
|
+
- @spectrum-web-components/styles@1.6.0
|
|
50
|
+
- @spectrum-web-components/overlay@1.6.0
|
|
51
|
+
- @spectrum-web-components/base@1.6.0
|
|
52
|
+
|
|
53
|
+
## 1.5.0
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [[`165a904`](https://github.com/adobe/spectrum-web-components/commit/165a904bd01fddea922fe87b181bbf41281f81f0), [`4e06533`](https://github.com/adobe/spectrum-web-components/commit/4e065332e0236757fc3a050e53747ce82ac40ed5), [`fa4be70`](https://github.com/adobe/spectrum-web-components/commit/fa4be70e9ab9dbeff26867edd3bdeb3f41c423e3), [`daeb11f`](https://github.com/adobe/spectrum-web-components/commit/daeb11f18792cf650518099fd29857139b6380b4), [`8f8735c`](https://github.com/adobe/spectrum-web-components/commit/8f8735c9ec3eac3b6473424c78257cb46ee17f70), [`6c58f50`](https://github.com/adobe/spectrum-web-components/commit/6c58f50f7b1f5489c11e0d3484e3f4a9d576f1c8), [`fa4be70`](https://github.com/adobe/spectrum-web-components/commit/fa4be70e9ab9dbeff26867edd3bdeb3f41c423e3)]:
|
|
58
|
+
- @spectrum-web-components/styles@1.5.0
|
|
59
|
+
- @spectrum-web-components/overlay@1.5.0
|
|
60
|
+
- @spectrum-web-components/tooltip@1.5.0
|
|
61
|
+
- @spectrum-web-components/base@1.5.0
|
|
62
|
+
|
|
63
|
+
## 1.4.0
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [[`3cca7ea`](https://github.com/adobe/spectrum-web-components/commit/3cca7eacf127c3fd759953db38a2b5a561bfb8dc), [`46cd782`](https://github.com/adobe/spectrum-web-components/commit/46cd7828f65491fc08790e5ba0aec412ee89199d), [`70f5f6f`](https://github.com/adobe/spectrum-web-components/commit/70f5f6f3a97b530fb20f9f5ee049e9a8c124b02d)]:
|
|
68
|
+
- @spectrum-web-components/styles@1.4.0
|
|
69
|
+
- @spectrum-web-components/overlay@1.4.0
|
|
70
|
+
- @spectrum-web-components/tooltip@1.4.0
|
|
71
|
+
- @spectrum-web-components/base@1.4.0
|
|
72
|
+
|
|
73
|
+
## 1.3.0
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Updated dependencies [[`468314f`](https://github.com/adobe/spectrum-web-components/commit/468314f45cf5fedb2e9029da210a5886260abca9)]:
|
|
78
|
+
- @spectrum-web-components/overlay@1.3.0
|
|
79
|
+
- @spectrum-web-components/tooltip@1.3.0
|
|
80
|
+
- @spectrum-web-components/base@1.3.0
|
|
81
|
+
- @spectrum-web-components/styles@1.3.0
|
|
82
|
+
|
|
83
|
+
All notable changes to this project will be documented in this file.
|
|
84
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
85
|
+
|
|
86
|
+
# [1.2.0](https://github.com/adobe/spectrum-web-components/compare/v1.1.2...v1.2.0) (2025-02-27)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
89
|
+
|
|
90
|
+
## [1.1.2](https://github.com/adobe/spectrum-web-components/compare/v1.1.1...v1.1.2) (2025-02-12)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
93
|
+
|
|
94
|
+
## [1.1.1](https://github.com/adobe/spectrum-web-components/compare/v1.1.0...v1.1.1) (2025-01-29)
|
|
95
|
+
|
|
96
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
97
|
+
|
|
98
|
+
# [1.1.0](https://github.com/adobe/spectrum-web-components/compare/v1.0.3...v1.1.0) (2025-01-29)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
101
|
+
|
|
102
|
+
## [1.0.3](https://github.com/adobe/spectrum-web-components/compare/v1.0.1...v1.0.3) (2024-12-09)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
105
|
+
|
|
106
|
+
## [1.0.1](https://github.com/adobe/spectrum-web-components/compare/v1.0.0...v1.0.1) (2024-11-11)
|
|
107
|
+
|
|
108
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
109
|
+
|
|
110
|
+
# [1.0.0](https://github.com/adobe/spectrum-web-components/compare/v0.49.0...v1.0.0) (2024-10-31)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
113
|
+
|
|
114
|
+
# [0.49.0](https://github.com/adobe/spectrum-web-components/compare/v0.48.1...v0.49.0) (2024-10-15)
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
- add `static-color` to replace `static` ([#4808](https://github.com/adobe/spectrum-web-components/issues/4808)) ([43cf086](https://github.com/adobe/spectrum-web-components/commit/43cf0865d902346568c755650f53410c7788f2a1))
|
|
119
|
+
|
|
120
|
+
## [0.48.1](https://github.com/adobe/spectrum-web-components/compare/v0.48.0...v0.48.1) (2024-10-01)
|
|
121
|
+
|
|
122
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
123
|
+
|
|
124
|
+
# [0.48.0](https://github.com/adobe/spectrum-web-components/compare/v0.47.2...v0.48.0) (2024-09-17)
|
|
125
|
+
|
|
126
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
127
|
+
|
|
128
|
+
## [0.47.2](https://github.com/adobe/spectrum-web-components/compare/v0.47.1...v0.47.2) (2024-09-03)
|
|
129
|
+
|
|
130
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
131
|
+
|
|
132
|
+
## [0.47.1](https://github.com/adobe/spectrum-web-components/compare/v0.47.0...v0.47.1) (2024-08-27)
|
|
133
|
+
|
|
134
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
135
|
+
|
|
136
|
+
# [0.47.0](https://github.com/adobe/spectrum-web-components/compare/v0.46.0...v0.47.0) (2024-08-20)
|
|
137
|
+
|
|
138
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
139
|
+
|
|
140
|
+
# [0.46.0](https://github.com/adobe/spectrum-web-components/compare/v0.45.0...v0.46.0) (2024-08-08)
|
|
141
|
+
|
|
142
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
143
|
+
|
|
144
|
+
# [0.45.0](https://github.com/adobe/spectrum-web-components/compare/v0.44.0...v0.45.0) (2024-07-30)
|
|
145
|
+
|
|
146
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
147
|
+
|
|
148
|
+
# [0.44.0](https://github.com/adobe/spectrum-web-components/compare/v0.42.4...v0.44.0) (2024-07-15)
|
|
149
|
+
|
|
150
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
151
|
+
|
|
152
|
+
# [0.43.0](https://github.com/adobe/spectrum-web-components/compare/v0.42.4...v0.43.0) (2024-06-11)
|
|
153
|
+
|
|
154
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
155
|
+
|
|
156
|
+
## [0.42.5](https://github.com/adobe/spectrum-web-components/compare/v0.42.4...v0.42.5) (2024-05-24)
|
|
157
|
+
|
|
158
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
159
|
+
|
|
160
|
+
## [0.42.4](https://github.com/adobe/spectrum-web-components/compare/v0.42.2...v0.42.4) (2024-05-14)
|
|
161
|
+
|
|
162
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
163
|
+
|
|
164
|
+
## [0.42.3](https://github.com/adobe/spectrum-web-components/compare/v0.42.2...v0.42.3) (2024-05-01)
|
|
165
|
+
|
|
166
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
167
|
+
|
|
168
|
+
## [0.42.2](https://github.com/adobe/spectrum-web-components/compare/v0.42.1...v0.42.2) (2024-04-03)
|
|
169
|
+
|
|
170
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
171
|
+
|
|
172
|
+
## [0.42.1](https://github.com/adobe/spectrum-web-components/compare/v0.42.0...v0.42.1) (2024-04-02)
|
|
173
|
+
|
|
174
|
+
**Note:** Version bump only for package @spectrum-web-components/truncated
|
|
175
|
+
|
|
176
|
+
# [0.42.0](https://github.com/adobe/spectrum-web-components/compare/v0.41.2...v0.42.0) (2024-03-19)
|
|
177
|
+
|
|
178
|
+
### Bug Fixes
|
|
179
|
+
|
|
180
|
+
- **truncated:** add truncated package ([#4163](https://github.com/adobe/spectrum-web-components/issues/4163)) ([4ba0480](https://github.com/adobe/spectrum-web-components/commit/4ba0480e2c471d8bba14eb898963ab0dca2f2d5a))
|
|
181
|
+
|
|
182
|
+
### Reverts
|
|
183
|
+
|
|
184
|
+
- Revert "Truncated element (#4125)" (#4160) ([da88bbe](https://github.com/adobe/spectrum-web-components/commit/da88bbe416a3ee5a991acdbceec2d698222e5f6a)), closes [#4125](https://github.com/adobe/spectrum-web-components/issues/4125) [#4160](https://github.com/adobe/spectrum-web-components/issues/4160)
|
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "@spectrum-web-components/truncated",
|
|
3
|
+
"version": "1.9.1-nightly.20251028214328",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Web component implementation of a Spectrum design Truncated",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/adobe/spectrum-web-components.git",
|
|
12
|
+
"directory": "1st-gen/tools/truncated"
|
|
13
|
+
},
|
|
14
|
+
"author": "Adobe",
|
|
15
|
+
"homepage": "https://adobe.github.io/spectrum-web-components/components/truncated",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/adobe/spectrum-web-components/issues"
|
|
18
|
+
},
|
|
19
|
+
"main": "./src/index.js",
|
|
20
|
+
"module": "./src/index.js",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
6
26
|
},
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"url": "https://github.com/adobe/spectrum-web-components.git",
|
|
12
|
-
"directory": "tools/truncated"
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
"./src/Truncated.js": {
|
|
29
|
+
"development": "./src/Truncated.dev.js",
|
|
30
|
+
"default": "./src/Truncated.js"
|
|
13
31
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"url": "https://github.com/adobe/spectrum-web-components/issues"
|
|
32
|
+
"./src/index.js": {
|
|
33
|
+
"development": "./src/index.dev.js",
|
|
34
|
+
"default": "./src/index.js"
|
|
18
35
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"lit-html",
|
|
63
|
-
"component",
|
|
64
|
-
"css"
|
|
65
|
-
],
|
|
66
|
-
"dependencies": {
|
|
67
|
-
"@spectrum-web-components/base": "1.9.0",
|
|
68
|
-
"@spectrum-web-components/overlay": "1.9.0",
|
|
69
|
-
"@spectrum-web-components/styles": "1.9.0",
|
|
70
|
-
"@spectrum-web-components/tooltip": "1.9.0"
|
|
71
|
-
},
|
|
72
|
-
"types": "./src/index.d.ts",
|
|
73
|
-
"customElements": "custom-elements.json",
|
|
74
|
-
"sideEffects": [
|
|
75
|
-
"./sp-*.js",
|
|
76
|
-
"./**/*.dev.js"
|
|
77
|
-
]
|
|
78
|
-
}
|
|
36
|
+
"./src/truncated.css.js": "./src/truncated.css.js",
|
|
37
|
+
"./sp-truncated": "./sp-truncated.js",
|
|
38
|
+
"./sp-truncated.js": {
|
|
39
|
+
"development": "./sp-truncated.dev.js",
|
|
40
|
+
"default": "./sp-truncated.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"**/*.d.ts",
|
|
48
|
+
"**/*.js",
|
|
49
|
+
"**/*.js.map",
|
|
50
|
+
"custom-elements.json",
|
|
51
|
+
"!stories/",
|
|
52
|
+
"!test/"
|
|
53
|
+
],
|
|
54
|
+
"keywords": [
|
|
55
|
+
"design-system",
|
|
56
|
+
"spectrum",
|
|
57
|
+
"adobe",
|
|
58
|
+
"adobe-spectrum",
|
|
59
|
+
"web components",
|
|
60
|
+
"web-components",
|
|
61
|
+
"lit-element",
|
|
62
|
+
"lit-html",
|
|
63
|
+
"component",
|
|
64
|
+
"css"
|
|
65
|
+
],
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@spectrum-web-components/base": "1.9.1-nightly.20251028214328",
|
|
68
|
+
"@spectrum-web-components/overlay": "1.9.1-nightly.20251028214328",
|
|
69
|
+
"@spectrum-web-components/styles": "1.9.1-nightly.20251028214328",
|
|
70
|
+
"@spectrum-web-components/tooltip": "1.9.1-nightly.20251028214328"
|
|
71
|
+
},
|
|
72
|
+
"types": "./src/index.d.ts",
|
|
73
|
+
"customElements": "custom-elements.json",
|
|
74
|
+
"sideEffects": [
|
|
75
|
+
"./sp-*.js",
|
|
76
|
+
"./**/*.dev.js"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["truncated.css.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{white-space:nowrap;text-overflow:ellipsis;min-width:0;max-width:100%;display:inline-block;overflow:hidden}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/truncated.css.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["truncated.css.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{white-space:nowrap;text-overflow:ellipsis;min-width:0;max-width:100%;display:inline-block;overflow:hidden}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAAA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "../sp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TVUZWoWQQfiU97EaOWGchSSAcjA6xrr0I2QrSxJUDIn/IBU5q5DOPu60u6KbclTNWVdDUWIVdM9vjjhIniXBEwd84OQTjrwT3qauddFty2fjTdaeGWSXlxYgnj4A/n4/fS/8A8PW723lZ9t22a8/ntVZqflc62QiZal2DoqlgSGwQxJBP7QM+dO+qoLHUk/mEdCIU7VhTGQr9cYznUfeattlTU1vgpw8fPEapqy9RFg3rv7NihKkqcZD+dGmSLPsgj/U6P7286Nc19m/b8/sZ4LO/iKfe3qLda+hobpctwpZZaCYGGSiZVLAkF0CIFyWUYyfGT9cwB3pPeLvTbgaeOZKvOFSYSEJxwrE58kf+DSGX1hsF6UwVEtWY2BAQK+CMd8hnBH9d60rBVWKCy0tue5vMKX3I2elOeAPuAgPjIAUZ+mddTSbFIYYY9YV0BUqZcO6UEl920gpalIZZIlZHftSx8D+8arts66xbv3beLFUpBFVUE0sdX7dVxD7NirZJOMch0frrjbhvK5VE8Iot61Vtio0RY6aCjVlXjkoSpYYx5HWNczW2e3124btfpd03SnrbpwNU9FBGgbgFxhWZgP2g+PPeqL31vmwz94pXsrpkDr6S59o29Y9p2eoijlgo5qoiNZKciKVip59Fck4yTj/l9dRz7krbWGSpm/NqRcKs0aFahBjsuv8Av/le/pqtm0tx0ez7cYjuK83andhKkdUqHDAceWfJJHnJ7+wxmuvrbSqrLHBUP0R2qdfXsHU67F2xXACNV1FBhmY85fU7bcUro13iRlYgqzEEHPgg9jRqsTeuKcm/y1z35Pse/wDro0vwt3ENyz2iltrt+EzyPw+Op+2uzA5YnKjOT/OjRoo0jXWbZRVZiAAWPZA86xVk8kdSeMjr+zwxHnlnRo1hpoaTetsryUhDOzAeATnUTe2IY9nyR5/nRo0NZ71kYigqCQPHy0aNGgxif//Z";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Truncated",
|
|
7
|
+
component: "sp-truncated"
|
|
8
|
+
};
|
|
9
|
+
export const Default = () => {
|
|
10
|
+
return html`
|
|
11
|
+
<p
|
|
12
|
+
style="width: 200px; color: #000; border: solid 1px #ccc; overflow: hidden; resize: both;"
|
|
13
|
+
>
|
|
14
|
+
<sp-truncated>
|
|
15
|
+
This is a
|
|
16
|
+
<strong>very long</strong>
|
|
17
|
+
🦋 sentence that 🦋 should be truncated
|
|
18
|
+
</sp-truncated>
|
|
19
|
+
<sp-truncated>
|
|
20
|
+
ThisIsAVeryLongWordThatShouldBeTruncated
|
|
21
|
+
</sp-truncated>
|
|
22
|
+
<sp-truncated>
|
|
23
|
+
We can even
|
|
24
|
+
<img src=${Dog} alt="kitten" />
|
|
25
|
+
truncate around a picture
|
|
26
|
+
</sp-truncated>
|
|
27
|
+
<sp-truncated>
|
|
28
|
+
Custom overflow content can also be provided for the tooltip
|
|
29
|
+
<span slot="overflow">
|
|
30
|
+
<span style="font-size: 24px;">Like this!</span>
|
|
31
|
+
</span>
|
|
32
|
+
</sp-truncated>
|
|
33
|
+
<sp-truncated placement="right">
|
|
34
|
+
Alternative placements can be specified
|
|
35
|
+
</sp-truncated>
|
|
36
|
+
<sp-truncated>Should have no tooltip</sp-truncated>
|
|
37
|
+
</p>
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=truncated.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["truncated.stories.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport '../sp-truncated.js';\n\nconst Dog =\n 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jA6xrr0I2QrSxJUDIn/IBU5q5DOPu60u6KbclTNWVdDUWIVdM9vjjhIniXBEwd84OQTjrwT3qauddFty2fjTdaeGWSXlxYgnj4A/n4/fS/8A8PW723lZ9t22a8/ntVZqflc62QiZal2DoqlgSGwQxJBP7QM+dO+qoLHUk/mEdCIU7VhTGQr9cYznUfeattlTU1vgpw8fPEapqy9RFg3rv7NihKkqcZD+dGmSLPsgj/U6P7286Nc19m/b8/sZ4LO/iKfe3qLda+hobpctwpZZaCYGGSiZVLAkF0CIFyWUYyfGT9cwB3pPeLvTbgaeOZKvOFSYSEJxwrE58kf+DSGX1hsF6UwVEtWY2BAQK+CMd8hnBH9d60rBVWKCy0tue5vMKX3I2elOeAPuAgPjIAUZ+mddTSbFIYYY9YV0BUqZcO6UEl920gpalIZZIlZHftSx8D+8arts66xbv3beLFUpBFVUE0sdX7dVxD7NirZJOMch0frrjbhvK5VE8Iot61Vtio0RY6aCjVlXjkoSpYYx5HWNczW2e3124btfpd03SnrbpwNU9FBGgbgFxhWZgP2g+PPeqL31vmwz94pXsrpkDr6S59o29Y9p2eoijlgo5qoiNZKciKVip59Fck4yTj/l9dRz7krbWGSpm/NqRcKs0aFahBjsuv8Av/le/pqtm0tx0ez7cYjuK83andhKkdUqHDAceWfJJHnJ7+wxmuvrbSqrLHBUP0R2qdfXsHU67F2xXACNV1FBhmY85fU7bcUro13iRlYgqzEEHPgg9jRqsTeuKcm/y1z35Pse/wDro0vwt3ENyz2iltrt+EzyPw+Op+2uzA5YnKjOT/OjRoo0jXWbZRVZiAAWPZA86xVk8kdSeMjr+zwxHnlnRo1hpoaTetsryUhDOzAeATnUTe2IY9nyR5/nRo0NZ71kYigqCQPHy0aNGgxif//Z';\n\nexport default {\n title: 'Truncated',\n component: 'sp-truncated',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <p\n style=\"width: 200px; color: #000; border: solid 1px #ccc; overflow: hidden; resize: both;\"\n >\n <sp-truncated>\n This is a\n <strong>very long</strong>\n \uD83E\uDD8B sentence that \uD83E\uDD8B should be truncated\n </sp-truncated>\n <sp-truncated>\n ThisIsAVeryLongWordThatShouldBeTruncated\n </sp-truncated>\n <sp-truncated>\n We can even\n <img src=${Dog} alt=\"kitten\" />\n truncate around a picture\n </sp-truncated>\n <sp-truncated>\n Custom overflow content can also be provided for the tooltip\n <span slot=\"overflow\">\n <span style=\"font-size: 24px;\">Like this!</span>\n </span>\n </sp-truncated>\n <sp-truncated placement=\"right\">\n Alternative placements can be specified\n </sp-truncated>\n <sp-truncated>Should have no tooltip</sp-truncated>\n </p>\n `;\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AACrC,OAAO;AAEP,MAAM,MACF;AAEJ,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,UAAU,MAAsB;AACzC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAcgB,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe9B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/truncated/sp-truncated.js";
|
|
3
|
+
import { html } from "@spectrum-web-components/base";
|
|
4
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
+
measureFixtureCreation(html`
|
|
6
|
+
<p style="width: 200px">
|
|
7
|
+
<sp-truncated>
|
|
8
|
+
This is a very long text that will overflow into a tooltip with the
|
|
9
|
+
help of sp-truncated.
|
|
10
|
+
</sp-truncated>
|
|
11
|
+
</p>
|
|
12
|
+
`);
|
|
13
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": ["basic-test.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport '@spectrum-web-components/truncated/sp-truncated.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <p style=\"width: 200px\">\n <sp-truncated>\n This is a very long text that will overflow into a tooltip with the\n help of sp-truncated.\n </sp-truncated>\n </p>\n`);\n"],
|
|
5
|
+
"mappings": ";AAWA,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAOtB;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {
|
|
5
|
-
"mappings": ";AAYA,SAAS,
|
|
3
|
+
"sources": ["truncated.test-vrt.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport * as stories from '../stories/truncated.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('TruncatedStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,oBAAoB,OAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import {
|
|
3
|
+
expect,
|
|
4
|
+
fixture,
|
|
5
|
+
fixtureCleanup,
|
|
6
|
+
html,
|
|
7
|
+
oneEvent
|
|
8
|
+
} from "@open-wc/testing";
|
|
9
|
+
import { isWebKit } from "@spectrum-web-components/shared";
|
|
10
|
+
import { mouseMoveOver } from "../../../test/testing-helpers.js";
|
|
11
|
+
import "../sp-truncated.js";
|
|
12
|
+
describe("Truncated", () => {
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
fixtureCleanup();
|
|
15
|
+
});
|
|
16
|
+
it("loads default truncated accessibly", async () => {
|
|
17
|
+
const el = await fixture(html`
|
|
18
|
+
<sp-truncated></sp-truncated>
|
|
19
|
+
`);
|
|
20
|
+
await expect(el).to.be.accessible();
|
|
21
|
+
});
|
|
22
|
+
it("renders a tooltip when overflowing", async () => {
|
|
23
|
+
const p = await fixture(html`
|
|
24
|
+
<p style="width: 20px">
|
|
25
|
+
<sp-truncated>This will overflow into a tooltip</sp-truncated>
|
|
26
|
+
</p>
|
|
27
|
+
`);
|
|
28
|
+
const el = p.querySelector("sp-truncated");
|
|
29
|
+
const tooltip = el.shadowRoot.querySelector("sp-tooltip");
|
|
30
|
+
await mouseMoveOver(el, "top-left");
|
|
31
|
+
const opened = oneEvent(el, "sp-opened");
|
|
32
|
+
await opened;
|
|
33
|
+
expect(tooltip.open).to.be.true;
|
|
34
|
+
});
|
|
35
|
+
it("does not render a tooltip when content fits", async () => {
|
|
36
|
+
const p = await fixture(html`
|
|
37
|
+
<p style="width: 200px">
|
|
38
|
+
<sp-truncated>Short</sp-truncated>
|
|
39
|
+
</p>
|
|
40
|
+
`);
|
|
41
|
+
const el = p.querySelector("sp-truncated");
|
|
42
|
+
const tooltip = el.shadowRoot.querySelector(
|
|
43
|
+
"sp-tooltip"
|
|
44
|
+
);
|
|
45
|
+
await mouseMoveOver(el, "top-left");
|
|
46
|
+
expect(tooltip).to.be.null;
|
|
47
|
+
});
|
|
48
|
+
it("detects whether or not custom overflow is specified for optimization", async () => {
|
|
49
|
+
const defaultOverflow = await fixture(html`
|
|
50
|
+
<sp-truncated>This will overflow into a tooltip</sp-truncated>
|
|
51
|
+
`);
|
|
52
|
+
const customOverflow = await fixture(html`
|
|
53
|
+
<sp-truncated>
|
|
54
|
+
Default
|
|
55
|
+
<span slot="overflow">Custom</span>
|
|
56
|
+
</sp-truncated>
|
|
57
|
+
`);
|
|
58
|
+
expect(defaultOverflow.hasCustomOverflow).to.be.false;
|
|
59
|
+
expect(customOverflow.hasCustomOverflow).to.be.true;
|
|
60
|
+
});
|
|
61
|
+
it("copies the text when clicked", async () => {
|
|
62
|
+
if (isWebKit()) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const text = "This will overflow into a tooltiptooltiptooltiptooltipmtooltipv tooltip tooltiptooltip";
|
|
66
|
+
const defaultOverflow = await fixture(html`
|
|
67
|
+
<p style="width: 200px">
|
|
68
|
+
<sp-truncated>${text}</sp-truncated>
|
|
69
|
+
</p>
|
|
70
|
+
`);
|
|
71
|
+
const truncated = defaultOverflow.querySelector("sp-truncated");
|
|
72
|
+
const content = truncated == null ? void 0 : truncated.shadowRoot.querySelector(
|
|
73
|
+
"#content"
|
|
74
|
+
);
|
|
75
|
+
content.click();
|
|
76
|
+
expect(truncated == null ? void 0 : truncated.hasCopied).to.be.true;
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=truncated.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["truncated.test.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n expect,\n fixture,\n fixtureCleanup,\n html,\n oneEvent,\n} from '@open-wc/testing';\nimport { Tooltip } from '@spectrum-web-components/tooltip/src/Tooltip.js';\n\nimport { isWebKit } from '@spectrum-web-components/shared';\nimport { mouseMoveOver } from '../../../test/testing-helpers.js';\nimport '../sp-truncated.js';\nimport { Truncated } from '../src/index.js';\n\ndescribe('Truncated', () => {\n afterEach(() => {\n fixtureCleanup();\n });\n it('loads default truncated accessibly', async () => {\n const el = await fixture<Truncated>(html`\n <sp-truncated></sp-truncated>\n `);\n\n await expect(el).to.be.accessible();\n });\n it('renders a tooltip when overflowing', async () => {\n const p = await fixture(html`\n <p style=\"width: 20px\">\n <sp-truncated>This will overflow into a tooltip</sp-truncated>\n </p>\n `);\n const el = p.querySelector('sp-truncated') as Truncated;\n const tooltip = el.shadowRoot!.querySelector('sp-tooltip') as Tooltip;\n\n await mouseMoveOver(el, 'top-left');\n const opened = oneEvent(el, 'sp-opened');\n\n await opened;\n expect(tooltip.open).to.be.true;\n });\n it('does not render a tooltip when content fits', async () => {\n const p = await fixture(html`\n <p style=\"width: 200px\">\n <sp-truncated>Short</sp-truncated>\n </p>\n `);\n const el = p.querySelector('sp-truncated') as Truncated;\n const tooltip = el.shadowRoot!.querySelector(\n 'sp-tooltip'\n ) as Tooltip | null;\n await mouseMoveOver(el, 'top-left');\n\n expect(tooltip).to.be.null;\n });\n it('detects whether or not custom overflow is specified for optimization', async () => {\n const defaultOverflow = await fixture<Truncated>(html`\n <sp-truncated>This will overflow into a tooltip</sp-truncated>\n `);\n const customOverflow = await fixture<Truncated>(html`\n <sp-truncated>\n Default\n <span slot=\"overflow\">Custom</span>\n </sp-truncated>\n `);\n\n expect(defaultOverflow.hasCustomOverflow).to.be.false;\n expect(customOverflow.hasCustomOverflow).to.be.true;\n });\n it('copies the text when clicked', async () => {\n // @TODO: skipping this test because it's flaky in WebKit in CI. Will review in the migration to Spectrum 2.\n if (isWebKit()) {\n return;\n }\n const text =\n 'This will overflow into a tooltiptooltiptooltiptooltipmtooltipv tooltip tooltiptooltip';\n\n const defaultOverflow = await fixture<Truncated>(html`\n <p style=\"width: 200px\">\n <sp-truncated>${text}</sp-truncated>\n </p>\n `);\n\n const truncated = defaultOverflow.querySelector('sp-truncated');\n const content = truncated?.shadowRoot.querySelector(\n '#content'\n ) as Truncated;\n content.click();\n expect(truncated?.hasC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AY;AAE3C,QAAI,SAAS,GAAG;AACZ;AAAA,IACJ;AACA,UAAM,OACF;AAEJ,UAAM,kBAAkB,MAAM,QAAmB;AAAA;AAAA,gCAEzB,IAAI;AAAA;AAAA,SAE3B;AAED,UAAM,YAAY,gBAAgB,cAAc,cAAc;AAC9D,UAAM,UAAU,uCAAW,WAAW;AAAA,MAClC;AAAA;AAEJ,YAAQ,MAAM;AACd,WAAO,uCAAW,SAAS,EAAE,GAAG,GAAG;AAAA,EACvC,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/custom-elements.json
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0.0",
|
|
3
|
-
"readme": "",
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"kind": "javascript-module",
|
|
7
|
-
"path": "sp-truncated.js",
|
|
8
|
-
"declarations": [],
|
|
9
|
-
"exports": [
|
|
10
|
-
{
|
|
11
|
-
"kind": "custom-element-definition",
|
|
12
|
-
"name": "sp-truncated",
|
|
13
|
-
"declaration": {
|
|
14
|
-
"name": "Truncated",
|
|
15
|
-
"module": "/src/Truncated.js"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"kind": "javascript-module",
|
|
22
|
-
"path": "src/Truncated.js",
|
|
23
|
-
"declarations": [
|
|
24
|
-
{
|
|
25
|
-
"kind": "class",
|
|
26
|
-
"description": "",
|
|
27
|
-
"name": "Truncated",
|
|
28
|
-
"members": [
|
|
29
|
-
{
|
|
30
|
-
"kind": "field",
|
|
31
|
-
"name": "placement",
|
|
32
|
-
"type": {
|
|
33
|
-
"text": "\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\""
|
|
34
|
-
},
|
|
35
|
-
"default": "'top-start'",
|
|
36
|
-
"attribute": "placement"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"kind": "field",
|
|
40
|
-
"name": "successMessage",
|
|
41
|
-
"type": {
|
|
42
|
-
"text": "string"
|
|
43
|
-
},
|
|
44
|
-
"default": "'Copied to clipboard'",
|
|
45
|
-
"attribute": "success-message"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"kind": "field",
|
|
49
|
-
"name": "hasCopied",
|
|
50
|
-
"type": {
|
|
51
|
-
"text": "boolean"
|
|
52
|
-
},
|
|
53
|
-
"default": "false"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"kind": "field",
|
|
57
|
-
"name": "fullText",
|
|
58
|
-
"type": {
|
|
59
|
-
"text": "string"
|
|
60
|
-
},
|
|
61
|
-
"privacy": "private",
|
|
62
|
-
"default": "''"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"kind": "field",
|
|
66
|
-
"name": "overflowing",
|
|
67
|
-
"type": {
|
|
68
|
-
"text": "boolean"
|
|
69
|
-
},
|
|
70
|
-
"privacy": "private",
|
|
71
|
-
"default": "false"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"kind": "field",
|
|
75
|
-
"name": "content",
|
|
76
|
-
"type": {
|
|
77
|
-
"text": "HTMLElement"
|
|
78
|
-
},
|
|
79
|
-
"privacy": "private"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"kind": "field",
|
|
83
|
-
"name": "overlayEl",
|
|
84
|
-
"type": {
|
|
85
|
-
"text": "Overlay | undefined"
|
|
86
|
-
},
|
|
87
|
-
"privacy": "private"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"kind": "field",
|
|
91
|
-
"name": "slottedContent",
|
|
92
|
-
"type": {
|
|
93
|
-
"text": "Node[]"
|
|
94
|
-
},
|
|
95
|
-
"privacy": "private"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"kind": "field",
|
|
99
|
-
"name": "slottedOverflow",
|
|
100
|
-
"type": {
|
|
101
|
-
"text": "HTMLElement[]"
|
|
102
|
-
},
|
|
103
|
-
"privacy": "private"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"kind": "field",
|
|
107
|
-
"name": "hasCustomOverflow",
|
|
108
|
-
"type": {
|
|
109
|
-
"text": "boolean"
|
|
110
|
-
},
|
|
111
|
-
"readonly": true
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"kind": "field",
|
|
115
|
-
"name": "resizeObserver",
|
|
116
|
-
"privacy": "private",
|
|
117
|
-
"default": "new ResizeObserver(() => { this.measureOverflow(); })"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"kind": "field",
|
|
121
|
-
"name": "mutationObserver",
|
|
122
|
-
"privacy": "private",
|
|
123
|
-
"default": "new MutationObserver(() => { this.copyText(); })"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"kind": "method",
|
|
127
|
-
"name": "renderTooltip",
|
|
128
|
-
"privacy": "private",
|
|
129
|
-
"return": {
|
|
130
|
-
"type": {
|
|
131
|
-
"text": "TemplateResult | undefined"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"kind": "method",
|
|
137
|
-
"name": "handleOverflowSlotchange",
|
|
138
|
-
"privacy": "private",
|
|
139
|
-
"return": {
|
|
140
|
-
"type": {
|
|
141
|
-
"text": "void"
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"kind": "method",
|
|
147
|
-
"name": "handleClick",
|
|
148
|
-
"privacy": "private",
|
|
149
|
-
"return": {
|
|
150
|
-
"type": {
|
|
151
|
-
"text": "void"
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"kind": "method",
|
|
157
|
-
"name": "measureOverflow",
|
|
158
|
-
"privacy": "private",
|
|
159
|
-
"return": {
|
|
160
|
-
"type": {
|
|
161
|
-
"text": "void"
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"kind": "method",
|
|
167
|
-
"name": "copyText",
|
|
168
|
-
"privacy": "private",
|
|
169
|
-
"return": {
|
|
170
|
-
"type": {
|
|
171
|
-
"text": "void"
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
],
|
|
176
|
-
"attributes": [
|
|
177
|
-
{
|
|
178
|
-
"name": "placement",
|
|
179
|
-
"type": {
|
|
180
|
-
"text": "\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\""
|
|
181
|
-
},
|
|
182
|
-
"default": "'top-start'",
|
|
183
|
-
"fieldName": "placement"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"name": "success-message",
|
|
187
|
-
"type": {
|
|
188
|
-
"text": "string"
|
|
189
|
-
},
|
|
190
|
-
"default": "'Copied to clipboard'",
|
|
191
|
-
"fieldName": "successMessage"
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
"superclass": {
|
|
195
|
-
"name": "SpectrumElement",
|
|
196
|
-
"package": "@spectrum-web-components/base"
|
|
197
|
-
},
|
|
198
|
-
"tagName": "sp-truncated",
|
|
199
|
-
"customElement": true
|
|
200
|
-
}
|
|
201
|
-
],
|
|
202
|
-
"exports": [
|
|
203
|
-
{
|
|
204
|
-
"kind": "js",
|
|
205
|
-
"name": "Truncated",
|
|
206
|
-
"declaration": {
|
|
207
|
-
"name": "Truncated",
|
|
208
|
-
"module": "src/Truncated.js"
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
]
|
|
214
|
-
}
|
package/sp-truncated.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2025 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { Truncated } from './src/Truncated.js';
|
|
13
|
-
declare global {
|
|
14
|
-
interface HTMLElementTagNameMap {
|
|
15
|
-
'sp-truncated': Truncated;
|
|
16
|
-
}
|
|
17
|
-
}
|
package/sp-truncated.dev.js
DELETED
package/sp-truncated.js
DELETED