@telia-ace/alliance-ui 1.0.12 → 1.0.13-next.1
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 +13 -0
- package/chunks/check-circle-filled-42095247.js.map +1 -1
- package/chunks/chevron-down-50d47dd6.js.map +1 -1
- package/chunks/chevron-right-788ce8a9.js.map +1 -1
- package/chunks/close-7d423291.js.map +1 -1
- package/chunks/close-ac6e4f1c.js.map +1 -1
- package/chunks/error-9925a844.js.map +1 -1
- package/chunks/error-filled-8de50bdd.js.map +1 -1
- package/chunks/getSvgContent-f2389ce0.js.map +1 -1
- package/chunks/{index-d925c796.js → index-514c4fef.js} +5 -5
- package/chunks/{index-d925c796.js.map → index-514c4fef.js.map} +1 -1
- package/chunks/index-eef143db.js.map +1 -1
- package/chunks/{query-assigned-elements-024d0918.js → query-assigned-elements-ac91685f.js} +117 -114
- package/chunks/query-assigned-elements-ac91685f.js.map +1 -0
- package/chunks/{repeat-600d2fb9.js → repeat-34adae9e.js} +2 -2
- package/chunks/{repeat-600d2fb9.js.map → repeat-34adae9e.js.map} +1 -1
- package/chunks/stringCombiner-10b57054.js.map +1 -1
- package/chunks/{telia-button2-7783c019.js → telia-button-c9ba09a9.js} +3 -3
- package/chunks/telia-button-c9ba09a9.js.map +1 -0
- package/chunks/{telia-card-frame2-340f3315.js → telia-card-frame-340f3315.js} +1 -1
- package/chunks/telia-card-frame-340f3315.js.map +1 -0
- package/chunks/{telia-field-assistive-text2-173ba2fb.js → telia-field-assistive-text-173ba2fb.js} +1 -1
- package/chunks/telia-field-assistive-text-173ba2fb.js.map +1 -0
- package/chunks/{telia-field-error2-75dc8ceb.js → telia-field-error-f978aeb3.js} +2 -2
- package/chunks/telia-field-error-f978aeb3.js.map +1 -0
- package/chunks/{telia-field-valid2-0f6759ac.js → telia-field-valid-5d8f121e.js} +2 -2
- package/chunks/telia-field-valid-5d8f121e.js.map +1 -0
- package/chunks/{telia-heading2-38ae44ae.js → telia-heading-38ae44ae.js} +1 -1
- package/chunks/telia-heading-38ae44ae.js.map +1 -0
- package/chunks/{telia-icon2-d0e7c715.js → telia-icon-d0e7c715.js} +1 -1
- package/chunks/telia-icon-d0e7c715.js.map +1 -0
- package/chunks/{telia-label2-f4c1eb47.js → telia-label-f4c1eb47.js} +1 -1
- package/chunks/telia-label-f4c1eb47.js.map +1 -0
- package/chunks/{telia-link2-9d6a1240.js → telia-link-42cb2e68.js} +2 -2
- package/chunks/telia-link-42cb2e68.js.map +1 -0
- package/chunks/{telia-style-link2-bb7bfd94.js → telia-style-link-bb7bfd94.js} +1 -1
- package/chunks/telia-style-link-bb7bfd94.js.map +1 -0
- package/chunks/{telia-tab-header2-73ec5e07.js → telia-tab-header-890fc7c8.js} +2 -2
- package/chunks/telia-tab-header-890fc7c8.js.map +1 -0
- package/chunks/{telia-text-input2-db9121d9.js → telia-text-input-289394d8.js} +6 -6
- package/chunks/telia-text-input-289394d8.js.map +1 -0
- package/chunks/{telia-visually-hidden2-9015e8cd.js → telia-visually-hidden-9015e8cd.js} +1 -1
- package/chunks/telia-visually-hidden-9015e8cd.js.map +1 -0
- package/chunks/telia-vst2-dfb33a56.js.map +1 -1
- package/chunks/uniqueId-0daf01ec.js.map +1 -1
- package/components/alliance-link.js +149 -2
- package/components/alliance-link.js.map +1 -1
- package/components/alliance-modal.js +234 -9
- package/components/alliance-modal.js.map +1 -1
- package/components/alliance-paginator.js +305 -10
- package/components/alliance-paginator.js.map +1 -1
- package/components/alliance-table.js +141 -5
- package/components/alliance-table.js.map +1 -1
- package/components/index.js +11 -11
- package/package.json +9 -11
- package/voca/components/telia-accordion-item.js +1 -1
- package/voca/components/telia-accordion-item.js.map +1 -1
- package/voca/components/telia-accordion.js +1 -1
- package/voca/components/telia-accordion.js.map +1 -1
- package/voca/components/telia-badge.js +1 -1
- package/voca/components/telia-badge.js.map +1 -1
- package/voca/components/telia-button.js +2 -2
- package/voca/components/telia-card-frame-link.js +3 -3
- package/voca/components/telia-card-frame-link.js.map +1 -1
- package/voca/components/telia-card-frame.js +1 -1
- package/voca/components/telia-checkbox.js +3 -3
- package/voca/components/telia-checkbox.js.map +1 -1
- package/voca/components/telia-chip-choice.js.map +1 -1
- package/voca/components/telia-chip-filter.js +1 -1
- package/voca/components/telia-chip-filter.js.map +1 -1
- package/voca/components/telia-col.js.map +1 -1
- package/voca/components/telia-color-dot.js +2 -1
- package/voca/components/telia-color-dot.js.map +1 -1
- package/voca/components/telia-counter-badge.js +1 -1
- package/voca/components/telia-counter-badge.js.map +1 -1
- package/voca/components/telia-cta-link.js +3 -3
- package/voca/components/telia-cta-link.js.map +1 -1
- package/voca/components/telia-date-picker.js +6 -6
- package/voca/components/telia-date-picker.js.map +1 -1
- package/voca/components/telia-divider.js.map +1 -1
- package/voca/components/telia-field-assistive-text.js +1 -1
- package/voca/components/telia-field-error.js +2 -2
- package/voca/components/telia-field-valid.js +2 -2
- package/voca/components/telia-fieldset.js.map +1 -1
- package/voca/components/telia-focus-trap.js.map +1 -1
- package/voca/components/telia-form.js.map +1 -1
- package/voca/components/telia-grid.js.map +1 -1
- package/voca/components/telia-heading.js +1 -1
- package/voca/components/telia-icon.js +1 -1
- package/voca/components/telia-image.js.map +1 -1
- package/voca/components/telia-label.js +1 -1
- package/voca/components/telia-link-image.js +3 -3
- package/voca/components/telia-link-image.js.map +1 -1
- package/voca/components/telia-link.js +2 -2
- package/voca/components/telia-list.js +1 -1
- package/voca/components/telia-list.js.map +1 -1
- package/voca/components/telia-logo.js.map +1 -1
- package/voca/components/telia-notification.js +3 -3
- package/voca/components/telia-notification.js.map +1 -1
- package/voca/components/telia-overlay.js.map +1 -1
- package/voca/components/telia-p.js.map +1 -1
- package/voca/components/telia-pictogram.js.map +1 -1
- package/voca/components/telia-radio-button.js +2 -2
- package/voca/components/telia-radio-button.js.map +1 -1
- package/voca/components/telia-row.js.map +1 -1
- package/voca/components/telia-search-input.js +7 -7
- package/voca/components/telia-search-input.js.map +1 -1
- package/voca/components/telia-select.js +4 -4
- package/voca/components/telia-select.js.map +1 -1
- package/voca/components/telia-skeleton.js.map +1 -1
- package/voca/components/telia-status-badge.js +1 -1
- package/voca/components/telia-status-badge.js.map +1 -1
- package/voca/components/telia-style-link.js +1 -1
- package/voca/components/telia-tab-content.js.map +1 -1
- package/voca/components/telia-tab-header.js +2 -2
- package/voca/components/telia-tab.js +3 -3
- package/voca/components/telia-tab.js.map +1 -1
- package/voca/components/telia-text-input.js +6 -6
- package/voca/components/telia-text-spacing.js.map +1 -1
- package/voca/components/telia-textarea.js +4 -4
- package/voca/components/telia-textarea.js.map +1 -1
- package/voca/components/telia-toggle.js +1 -1
- package/voca/components/telia-toggle.js.map +1 -1
- package/voca/components/telia-visually-hidden.js +1 -1
- package/voca/components/telia-voca-stats.js.map +1 -1
- package/voca/foundations/index.js +1 -1
- package/voca/foundations/index.js.map +1 -1
- package/voca/icons/index.js.map +1 -1
- package/chunks/alliance-link-8cb7d7d9.js +0 -259
- package/chunks/alliance-link-8cb7d7d9.js.map +0 -1
- package/chunks/alliance-modal-1126a4c4.js +0 -229
- package/chunks/alliance-modal-1126a4c4.js.map +0 -1
- package/chunks/alliance-paginator-button-0a0a4fd7.js +0 -305
- package/chunks/alliance-paginator-button-0a0a4fd7.js.map +0 -1
- package/chunks/alliance-table-row-ec104b1e.js +0 -142
- package/chunks/alliance-table-row-ec104b1e.js.map +0 -1
- package/chunks/query-assigned-elements-024d0918.js.map +0 -1
- package/chunks/telia-button2-7783c019.js.map +0 -1
- package/chunks/telia-card-frame2-340f3315.js.map +0 -1
- package/chunks/telia-field-assistive-text2-173ba2fb.js.map +0 -1
- package/chunks/telia-field-error2-75dc8ceb.js.map +0 -1
- package/chunks/telia-field-valid2-0f6759ac.js.map +0 -1
- package/chunks/telia-heading2-38ae44ae.js.map +0 -1
- package/chunks/telia-icon2-d0e7c715.js.map +0 -1
- package/chunks/telia-label2-f4c1eb47.js.map +0 -1
- package/chunks/telia-link2-9d6a1240.js.map +0 -1
- package/chunks/telia-navigation-button2-b6b0d39c.js +0 -44
- package/chunks/telia-navigation-button2-b6b0d39c.js.map +0 -1
- package/chunks/telia-style-link2-bb7bfd94.js.map +0 -1
- package/chunks/telia-style-navigation-item2-b2eaedc2.js +0 -44
- package/chunks/telia-style-navigation-item2-b2eaedc2.js.map +0 -1
- package/chunks/telia-tab-header2-73ec5e07.js.map +0 -1
- package/chunks/telia-text-input2-db9121d9.js.map +0 -1
- package/chunks/telia-visually-hidden2-9015e8cd.js.map +0 -1
- package/voca/components/telia-navigation-button.d.ts +0 -1
- package/voca/components/telia-navigation-button.js +0 -5
- package/voca/components/telia-navigation-button.js.map +0 -1
- package/voca/components/telia-navigation-dropdown.d.ts +0 -1
- package/voca/components/telia-navigation-dropdown.js +0 -85
- package/voca/components/telia-navigation-dropdown.js.map +0 -1
- package/voca/components/telia-navigation-link.d.ts +0 -1
- package/voca/components/telia-navigation-link.js +0 -40
- package/voca/components/telia-navigation-link.js.map +0 -1
- package/voca/components/telia-style-navigation-item.d.ts +0 -1
- package/voca/components/telia-style-navigation-item.js +0 -4
- package/voca/components/telia-style-navigation-item.js.map +0 -1
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { e as s, a as y, s as f, x as v } from "./query-assigned-elements-024d0918.js";
|
|
2
|
-
var g = Object.defineProperty, m = (e, t, r) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, l = (e, t, r) => (m(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
3
|
-
function S(e) {
|
|
4
|
-
const t = Object.entries(e).reduce((r, a) => {
|
|
5
|
-
const [i, o] = a;
|
|
6
|
-
return typeof o > "u" || (typeof o == "object" && o !== null ? r[i] = JSON.stringify(o) : r[i] = o), r;
|
|
7
|
-
}, {});
|
|
8
|
-
return Object.keys(t).length ? `?${new URLSearchParams(t)}` : "";
|
|
9
|
-
}
|
|
10
|
-
function w(e = "", t = "", r = {}) {
|
|
11
|
-
const a = D().replace(location.origin, ""), i = S(r);
|
|
12
|
-
return e ? t ? `${a}/${e}/${t}${i}` : `${a}/${e}${i}` : `${a}${i}`;
|
|
13
|
-
}
|
|
14
|
-
function D() {
|
|
15
|
-
return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;
|
|
16
|
-
}
|
|
17
|
-
var d = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = "AlreadyExists", e[e.ApiGatewayPortDescription = 1] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 2] = "ApiServerModeDescription", e[e.AppConfigurationPath = 3] = "AppConfigurationPath", e[e.AppCreated = 4] = "AppCreated", e[e.AppEntryBuildOptionDescription = 5] = "AppEntryBuildOptionDescription", e[e.AppNameInquiry = 6] = "AppNameInquiry", e[e.BuildDescription = 7] = "BuildDescription", e[e.BuildModeOptionDescription = 8] = "BuildModeOptionDescription", e[e.BuildWatchDescription = 9] = "BuildWatchDescription", e[e.CreateAppDescription = 10] = "CreateAppDescription", e[e.CreateWorkspaceDescription = 11] = "CreateWorkspaceDescription", e[e.DevServerOpenDescription = 12] = "DevServerOpenDescription", e[e.DevServerPortDescription = 13] = "DevServerPortDescription", e[e.DevServerLoggingDescription = 14] = "DevServerLoggingDescription", e[e.Done = 15] = "Done", e[e.FetchPackageVersionError = 16] = "FetchPackageVersionError", e[e.ManifestEntryBuildOptionDescription = 17] = "ManifestEntryBuildOptionDescription", e[e.MissingTranslationKey = 18] = "MissingTranslationKey", e[e.NoAppName = 19] = "NoAppName", e[e.NoAppNameFound = 20] = "NoAppNameFound", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = "NoAppOrWorkspaceInCurrentDirectory", e[e.NoWorkspaceName = 22] = "NoWorkspaceName", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.ServeDescription = 24] = "ServeDescription", e[e.ServedStopped = 25] = "ServedStopped", e[e.ServerGatewayMode = 26] = "ServerGatewayMode", e[e.ServerMode = 27] = "ServerMode", e[e.ServerModeInquiry = 28] = "ServerModeInquiry", e[e.ServerProxyMode = 29] = "ServerProxyMode", e[e.StopServerInstructions = 30] = "StopServerInstructions", e[e.TemplateFrameworkInquiry = 31] = "TemplateFrameworkInquiry", e[e.TemplateLanguageInquiry = 32] = "TemplateLanguageInquiry", e[e.UnrecognizedCommand = 33] = "UnrecognizedCommand", e[e.WorkspaceCreated = 34] = "WorkspaceCreated", e[e.WorkspaceNameInquiry = 35] = "WorkspaceNameInquiry", e))(d || {});
|
|
18
|
-
const b = {
|
|
19
|
-
[
|
|
20
|
-
15
|
|
21
|
-
/* Done */
|
|
22
|
-
]: "Done",
|
|
23
|
-
[
|
|
24
|
-
22
|
|
25
|
-
/* NoWorkspaceName */
|
|
26
|
-
]: "No workspace name provided!",
|
|
27
|
-
[
|
|
28
|
-
19
|
|
29
|
-
/* NoAppName */
|
|
30
|
-
]: "No app name provided!",
|
|
31
|
-
[
|
|
32
|
-
0
|
|
33
|
-
/* AlreadyExists */
|
|
34
|
-
]: "File or directory '{0}' already exists!",
|
|
35
|
-
[
|
|
36
|
-
21
|
|
37
|
-
/* NoAppOrWorkspaceInCurrentDirectory */
|
|
38
|
-
]: "Could not find any app entry file at '{0}'!",
|
|
39
|
-
[
|
|
40
|
-
33
|
|
41
|
-
/* UnrecognizedCommand */
|
|
42
|
-
]: "Unrecognized command(s) {0}!",
|
|
43
|
-
[
|
|
44
|
-
34
|
|
45
|
-
/* WorkspaceCreated */
|
|
46
|
-
]: "Workspace was created at path '{0}'!",
|
|
47
|
-
[
|
|
48
|
-
4
|
|
49
|
-
/* AppCreated */
|
|
50
|
-
]: "App was created at path '{0}'!",
|
|
51
|
-
[
|
|
52
|
-
25
|
|
53
|
-
/* ServedStopped */
|
|
54
|
-
]: "Server stopped.",
|
|
55
|
-
[
|
|
56
|
-
11
|
|
57
|
-
/* CreateWorkspaceDescription */
|
|
58
|
-
]: "Creates an Alliance Workspace in the current directory.",
|
|
59
|
-
[
|
|
60
|
-
10
|
|
61
|
-
/* CreateAppDescription */
|
|
62
|
-
]: "Creates an Alliance Application in the current directory or Alliance Workspace.",
|
|
63
|
-
[
|
|
64
|
-
24
|
|
65
|
-
/* ServeDescription */
|
|
66
|
-
]: "Starts a Alliance development server using the current directory package.json.",
|
|
67
|
-
[
|
|
68
|
-
7
|
|
69
|
-
/* BuildDescription */
|
|
70
|
-
]: "Builds an Alliance Application using Vite.",
|
|
71
|
-
[
|
|
72
|
-
35
|
|
73
|
-
/* WorkspaceNameInquiry */
|
|
74
|
-
]: "Enter the name of your workspace",
|
|
75
|
-
[
|
|
76
|
-
28
|
|
77
|
-
/* ServerModeInquiry */
|
|
78
|
-
]: "Which server mode do you want to use?",
|
|
79
|
-
[
|
|
80
|
-
6
|
|
81
|
-
/* AppNameInquiry */
|
|
82
|
-
]: "Enter the name of your app",
|
|
83
|
-
[
|
|
84
|
-
18
|
|
85
|
-
/* MissingTranslationKey */
|
|
86
|
-
]: "No translation key provided!",
|
|
87
|
-
[
|
|
88
|
-
23
|
|
89
|
-
/* OperationCancelled */
|
|
90
|
-
]: "Operation cancelled.",
|
|
91
|
-
[
|
|
92
|
-
30
|
|
93
|
-
/* StopServerInstructions */
|
|
94
|
-
]: `Press CTRL + C to stop the server.
|
|
95
|
-
`,
|
|
96
|
-
[
|
|
97
|
-
32
|
|
98
|
-
/* TemplateLanguageInquiry */
|
|
99
|
-
]: "Select preferred language",
|
|
100
|
-
[
|
|
101
|
-
31
|
|
102
|
-
/* TemplateFrameworkInquiry */
|
|
103
|
-
]: "Select preferred framework template",
|
|
104
|
-
[
|
|
105
|
-
13
|
|
106
|
-
/* DevServerPortDescription */
|
|
107
|
-
]: "The port that the dev server should use.",
|
|
108
|
-
[
|
|
109
|
-
14
|
|
110
|
-
/* DevServerLoggingDescription */
|
|
111
|
-
]: "Whether the dev server and browser console should output more log information or not (false).",
|
|
112
|
-
[
|
|
113
|
-
1
|
|
114
|
-
/* ApiGatewayPortDescription */
|
|
115
|
-
]: "The port that the api gateway should use.",
|
|
116
|
-
[
|
|
117
|
-
2
|
|
118
|
-
/* ApiServerModeDescription */
|
|
119
|
-
]: "Which components to start. [server|server-proxy|server-gateway].",
|
|
120
|
-
[
|
|
121
|
-
12
|
|
122
|
-
/* DevServerOpenDescription */
|
|
123
|
-
]: "Whether the dev server should automatically open in your browser or not.",
|
|
124
|
-
[
|
|
125
|
-
9
|
|
126
|
-
/* BuildWatchDescription */
|
|
127
|
-
]: "Whether the build should start watching and rebuild when files change or not.",
|
|
128
|
-
[
|
|
129
|
-
5
|
|
130
|
-
/* AppEntryBuildOptionDescription */
|
|
131
|
-
]: "The entry file for the app (./src/app).",
|
|
132
|
-
[
|
|
133
|
-
17
|
|
134
|
-
/* ManifestEntryBuildOptionDescription */
|
|
135
|
-
]: "The entry file for the app manifest (./src/manifest).",
|
|
136
|
-
[
|
|
137
|
-
8
|
|
138
|
-
/* BuildModeOptionDescription */
|
|
139
|
-
]: "Which mode to use when building the app.",
|
|
140
|
-
[
|
|
141
|
-
16
|
|
142
|
-
/* FetchPackageVersionError */
|
|
143
|
-
]: "Failed to fetch package info from the NPM registry for package '${0}'!",
|
|
144
|
-
[
|
|
145
|
-
20
|
|
146
|
-
/* NoAppNameFound */
|
|
147
|
-
]: "Could not find app name in manifest.",
|
|
148
|
-
[
|
|
149
|
-
3
|
|
150
|
-
/* AppConfigurationPath */
|
|
151
|
-
]: "The path to the app configuration file.",
|
|
152
|
-
[
|
|
153
|
-
27
|
|
154
|
-
/* ServerMode */
|
|
155
|
-
]: "Server",
|
|
156
|
-
[
|
|
157
|
-
29
|
|
158
|
-
/* ServerProxyMode */
|
|
159
|
-
]: "Server with proxy",
|
|
160
|
-
[
|
|
161
|
-
26
|
|
162
|
-
/* ServerGatewayMode */
|
|
163
|
-
]: "Server with gateway"
|
|
164
|
-
}, h = class {
|
|
165
|
-
};
|
|
166
|
-
let u = h;
|
|
167
|
-
l(u, "getTranslations", () => b), l(u, "getTranslation", (e, ...t) => {
|
|
168
|
-
const r = h.getTranslations()[e];
|
|
169
|
-
if (!r)
|
|
170
|
-
throw new Error(`Could not find text with given key '${e}'.`);
|
|
171
|
-
return t.reduce(
|
|
172
|
-
(a, i, o) => a.toString().replace(`{${o}}`, i.toString()),
|
|
173
|
-
r
|
|
174
|
-
).toString();
|
|
175
|
-
}), l(u, "get", (e = d.MissingTranslationKey, ...t) => h.getTranslation(e, ...t));
|
|
176
|
-
function k(e) {
|
|
177
|
-
return (t) => {
|
|
178
|
-
t.key === "Enter" && e(t);
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
var A = Object.defineProperty, C = Object.getOwnPropertyDescriptor, p = (e, t, r, a) => {
|
|
182
|
-
for (var i = a > 1 ? void 0 : a ? C(t, r) : t, o = e.length - 1, c; o >= 0; o--)
|
|
183
|
-
(c = e[o]) && (i = (a ? c(t, r, i) : c(i)) || i);
|
|
184
|
-
return a && i && A(t, r, i), i;
|
|
185
|
-
};
|
|
186
|
-
function N(e = "") {
|
|
187
|
-
return location.href.replace(location.origin, "").startsWith(e);
|
|
188
|
-
}
|
|
189
|
-
let n = class extends f {
|
|
190
|
-
constructor() {
|
|
191
|
-
super(...arguments), this.capability = "", this.app = "", this.args = {}, this.navigate = () => {
|
|
192
|
-
history.pushState(this.args, "", this._href), window.dispatchEvent(new Event("popstate"));
|
|
193
|
-
}, this.clickHandler = (e) => {
|
|
194
|
-
this.href || this.download || (e.preventDefault(), this.navigate());
|
|
195
|
-
}, this.updateActive = () => {
|
|
196
|
-
this.active = N(this._href);
|
|
197
|
-
}, this._href = "", this.active = !1, this.computeHref = () => {
|
|
198
|
-
if (this.href)
|
|
199
|
-
return this._href = this.href;
|
|
200
|
-
if (!this.app)
|
|
201
|
-
throw new Error("The app property is required when creating a capability link!");
|
|
202
|
-
this._href = w(this.app, this.capability, this.args), this.updateActive();
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
connectedCallback() {
|
|
206
|
-
super.connectedCallback(), window.addEventListener("popstate", this.updateActive), this.computeHref();
|
|
207
|
-
}
|
|
208
|
-
disconnectedCallback() {
|
|
209
|
-
window.removeEventListener("popstate", this.updateActive), super.disconnectedCallback();
|
|
210
|
-
}
|
|
211
|
-
attributeChangedCallback(e, t, r) {
|
|
212
|
-
super.attributeChangedCallback(e, t, r), setTimeout(() => this.computeHref());
|
|
213
|
-
}
|
|
214
|
-
render() {
|
|
215
|
-
return v`<a
|
|
216
|
-
part="anchor"
|
|
217
|
-
target=${this.target}
|
|
218
|
-
rel=${this.rel}
|
|
219
|
-
download=${this.download}
|
|
220
|
-
.href=${this._href}
|
|
221
|
-
?active=${this.active}
|
|
222
|
-
@click=${this.clickHandler}
|
|
223
|
-
@keydown=${k(this.clickHandler)}
|
|
224
|
-
>
|
|
225
|
-
<slot></slot>
|
|
226
|
-
</a>`;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
p([
|
|
230
|
-
s({ type: String, attribute: !0, reflect: !0 })
|
|
231
|
-
], n.prototype, "capability", 2);
|
|
232
|
-
p([
|
|
233
|
-
s({ type: String, attribute: !0, reflect: !0 })
|
|
234
|
-
], n.prototype, "app", 2);
|
|
235
|
-
p([
|
|
236
|
-
s({ type: Object, attribute: !0, reflect: !0 })
|
|
237
|
-
], n.prototype, "args", 2);
|
|
238
|
-
p([
|
|
239
|
-
s({ type: String, attribute: !0, reflect: !0 })
|
|
240
|
-
], n.prototype, "href", 2);
|
|
241
|
-
p([
|
|
242
|
-
s({ type: String })
|
|
243
|
-
], n.prototype, "target", 2);
|
|
244
|
-
p([
|
|
245
|
-
s({ type: String, attribute: !0, reflect: !0 })
|
|
246
|
-
], n.prototype, "rel", 2);
|
|
247
|
-
p([
|
|
248
|
-
s({ type: String, attribute: !0, reflect: !0 })
|
|
249
|
-
], n.prototype, "download", 2);
|
|
250
|
-
p([
|
|
251
|
-
s({ type: String, attribute: !1, reflect: !1 })
|
|
252
|
-
], n.prototype, "_href", 2);
|
|
253
|
-
p([
|
|
254
|
-
s({ type: Boolean, attribute: "active", reflect: !0 })
|
|
255
|
-
], n.prototype, "active", 2);
|
|
256
|
-
n = p([
|
|
257
|
-
y("alliance-link")
|
|
258
|
-
], n);
|
|
259
|
-
//# sourceMappingURL=alliance-link-8cb7d7d9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alliance-link-8cb7d7d9.js","sources":["../../../internal/client-utilities/dist/index.js","../src/components/alliance-link/alliance-link.ts"],"sourcesContent":["var f = Object.defineProperty;\nvar v = (e, t, r) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;\nvar a = (e, t, r) => (v(e, typeof t != \"symbol\" ? t + \"\" : t, r), r);\nvar N = /* @__PURE__ */ ((e) => (e[e.AlreadyInitialized = 1e3] = \"AlreadyInitialized\", e[e.NoAppNameOrKey = 1001] = \"NoAppNameOrKey\", e[e.MissingAppController = 1002] = \"MissingAppController\", e[e.MissingCapabilityOnApp = 1003] = \"MissingCapabilityOnApp\", e[e.MissingManagedObjectProvider = 1004] = \"MissingManagedObjectProvider\", e[e.NoManifest = 1005] = \"NoManifest\", e[e.NoRootElement = 1006] = \"NoRootElement\", e[e.NoView = 1007] = \"NoView\", e[e.CookieKeyNotDefined = 1008] = \"CookieKeyNotDefined\", e[e.CookieCategoryNotAllowed = 1009] = \"CookieCategoryNotAllowed\", e[e.StorageKeyNotDefined = 1010] = \"StorageKeyNotDefined\", e[e.StorageCategoryNotAllowed = 1011] = \"StorageCategoryNotAllowed\", e))(N || {}), A = /* @__PURE__ */ ((e) => (e[e.CurrentUserMissingProvider = 2e3] = \"CurrentUserMissingProvider\", e[e.CurrentUserGatewayNotStarted = 2001] = \"CurrentUserGatewayNotStarted\", e[e.CurrentUserMissingBackend = 2002] = \"CurrentUserMissingBackend\", e[e.CurrentUserMissingInDatabase = 2003] = \"CurrentUserMissingInDatabase\", e))(A || {});\nfunction m(e, t) {\n return Object.entries(t).reduce((r, [i, n]) => r.replaceAll(`{{${i}}}`, n), e);\n}\nconst S = {\n // framework\n [\n 1e3\n /* AlreadyInitialized */\n ]: \"The runtime has already been initialized\",\n [\n 1001\n /* NoAppNameOrKey */\n ]: \"App name and/or app key is not defined on global scope\",\n [\n 1002\n /* MissingAppController */\n ]: \"No app controller registered for app '{{app}}'\",\n [\n 1003\n /* MissingCapabilityOnApp */\n ]: \"No capability '{{capability}}' enabled for app '{{app}}'\",\n [\n 1004\n /* MissingManagedObjectProvider */\n ]: \"No managed object provider registered for object '{{object}}'\",\n [\n 1005\n /* NoManifest */\n ]: \"The current apps manifest is not defined on global scope\",\n [\n 1006\n /* NoRootElement */\n ]: \"Could not find the root element in the DOM\",\n [\n 1007\n /* NoView */\n ]: \"Could not find view with id '{{id}}' on view controller for app '{{app}}'\",\n [\n 1008\n /* CookieKeyNotDefined */\n ]: \"Cookie key '{{key}}' not present in manifest, cookie has not been set\",\n [\n 1009\n /* CookieCategoryNotAllowed */\n ]: \"Cookies categorized as '{{category}}' are not allowed by the user, cookie '{{key}}' has not been set\",\n [\n 1010\n /* StorageKeyNotDefined */\n ]: \"Storage key '{{key}}' not present in manifest, item has not been stored\",\n [\n 1011\n /* StorageCategoryNotAllowed */\n ]: \"Storage categorized as '{{category}}' is not allowed by the user, item '{{key}}' has not been stored\",\n // utilities\n [\n 2e3\n /* CurrentUserMissingProvider */\n ]: \"No managed object provider registered for object 'currentUser'\",\n [\n 2001\n /* CurrentUserGatewayNotStarted */\n ]: \"Could not access the gateway when querying 'currentUser'\",\n [\n 2002\n /* CurrentUserMissingBackend */\n ]: \"Could not access the required backend when querying 'currentUser'\",\n [\n 2003\n /* CurrentUserMissingInDatabase */\n ]: \"Could not locate the authenticated user in the Alliance database\"\n}, d = \"AllianceError\";\nclass C extends Error {\n constructor(t, r = {}) {\n const i = m(S[t], r), n = `https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${t}`;\n super(i), this.code = t, this.name = d, this.stack = `[${t}] - ${i}\n` + n;\n }\n}\nfunction I(e) {\n return !!e.code && e.name === d;\n}\nfunction D(e) {\n const r = Object.entries(e).reduce((i, n) => {\n const [o, p] = n;\n return typeof p > \"u\" || (typeof p == \"object\" && p !== null ? i[o] = JSON.stringify(p) : i[o] = p), i;\n }, {});\n return Object.keys(r).length ? `?${new URLSearchParams(r)}` : \"\";\n}\nfunction b() {\n const e = l(), { href: t, search: r } = window.location;\n return t.replace(e, \"\").replace(r, \"\");\n}\nfunction k(e = \"\", t = \"\", r = {}) {\n const i = l().replace(location.origin, \"\"), n = D(r);\n return e ? t ? `${i}/${e}/${t}${n}` : `${i}/${e}${n}` : `${i}${n}`;\n}\nfunction W() {\n const e = b(), [t = \"\", r = \"\"] = e.split(\"/\").filter((i) => !!i);\n return {\n app: t,\n capability: r\n };\n}\nfunction P(e) {\n const { origin: t, pathname: r } = window.location;\n if (e === \"production\") {\n const [i] = r.split(\"/\").filter((n) => !!n);\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = `${t}/${i}`;\n }\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL = t;\n}\nfunction l() {\n return globalThis.__ALLIANCE_RUNTIME_ROOT_URL;\n}\nvar s = /* @__PURE__ */ ((e) => (e[e.AlreadyExists = 0] = \"AlreadyExists\", e[e.ApiGatewayPortDescription = 1] = \"ApiGatewayPortDescription\", e[e.ApiServerModeDescription = 2] = \"ApiServerModeDescription\", e[e.AppConfigurationPath = 3] = \"AppConfigurationPath\", e[e.AppCreated = 4] = \"AppCreated\", e[e.AppEntryBuildOptionDescription = 5] = \"AppEntryBuildOptionDescription\", e[e.AppNameInquiry = 6] = \"AppNameInquiry\", e[e.BuildDescription = 7] = \"BuildDescription\", e[e.BuildModeOptionDescription = 8] = \"BuildModeOptionDescription\", e[e.BuildWatchDescription = 9] = \"BuildWatchDescription\", e[e.CreateAppDescription = 10] = \"CreateAppDescription\", e[e.CreateWorkspaceDescription = 11] = \"CreateWorkspaceDescription\", e[e.DevServerOpenDescription = 12] = \"DevServerOpenDescription\", e[e.DevServerPortDescription = 13] = \"DevServerPortDescription\", e[e.DevServerLoggingDescription = 14] = \"DevServerLoggingDescription\", e[e.Done = 15] = \"Done\", e[e.FetchPackageVersionError = 16] = \"FetchPackageVersionError\", e[e.ManifestEntryBuildOptionDescription = 17] = \"ManifestEntryBuildOptionDescription\", e[e.MissingTranslationKey = 18] = \"MissingTranslationKey\", e[e.NoAppName = 19] = \"NoAppName\", e[e.NoAppNameFound = 20] = \"NoAppNameFound\", e[e.NoAppOrWorkspaceInCurrentDirectory = 21] = \"NoAppOrWorkspaceInCurrentDirectory\", e[e.NoWorkspaceName = 22] = \"NoWorkspaceName\", e[e.OperationCancelled = 23] = \"OperationCancelled\", e[e.ServeDescription = 24] = \"ServeDescription\", e[e.ServedStopped = 25] = \"ServedStopped\", e[e.ServerGatewayMode = 26] = \"ServerGatewayMode\", e[e.ServerMode = 27] = \"ServerMode\", e[e.ServerModeInquiry = 28] = \"ServerModeInquiry\", e[e.ServerProxyMode = 29] = \"ServerProxyMode\", e[e.StopServerInstructions = 30] = \"StopServerInstructions\", e[e.TemplateFrameworkInquiry = 31] = \"TemplateFrameworkInquiry\", e[e.TemplateLanguageInquiry = 32] = \"TemplateLanguageInquiry\", e[e.UnrecognizedCommand = 33] = \"UnrecognizedCommand\", e[e.WorkspaceCreated = 34] = \"WorkspaceCreated\", e[e.WorkspaceNameInquiry = 35] = \"WorkspaceNameInquiry\", e))(s || {});\nconst M = {\n [\n 15\n /* Done */\n ]: \"Done\",\n [\n 22\n /* NoWorkspaceName */\n ]: \"No workspace name provided!\",\n [\n 19\n /* NoAppName */\n ]: \"No app name provided!\",\n [\n 0\n /* AlreadyExists */\n ]: \"File or directory '{0}' already exists!\",\n [\n 21\n /* NoAppOrWorkspaceInCurrentDirectory */\n ]: \"Could not find any app entry file at '{0}'!\",\n [\n 33\n /* UnrecognizedCommand */\n ]: \"Unrecognized command(s) {0}!\",\n [\n 34\n /* WorkspaceCreated */\n ]: \"Workspace was created at path '{0}'!\",\n [\n 4\n /* AppCreated */\n ]: \"App was created at path '{0}'!\",\n [\n 25\n /* ServedStopped */\n ]: \"Server stopped.\",\n [\n 11\n /* CreateWorkspaceDescription */\n ]: \"Creates an Alliance Workspace in the current directory.\",\n [\n 10\n /* CreateAppDescription */\n ]: \"Creates an Alliance Application in the current directory or Alliance Workspace.\",\n [\n 24\n /* ServeDescription */\n ]: \"Starts a Alliance development server using the current directory package.json.\",\n [\n 7\n /* BuildDescription */\n ]: \"Builds an Alliance Application using Vite.\",\n [\n 35\n /* WorkspaceNameInquiry */\n ]: \"Enter the name of your workspace\",\n [\n 28\n /* ServerModeInquiry */\n ]: \"Which server mode do you want to use?\",\n [\n 6\n /* AppNameInquiry */\n ]: \"Enter the name of your app\",\n [\n 18\n /* MissingTranslationKey */\n ]: \"No translation key provided!\",\n [\n 23\n /* OperationCancelled */\n ]: \"Operation cancelled.\",\n [\n 30\n /* StopServerInstructions */\n ]: `Press CTRL + C to stop the server.\n`,\n [\n 32\n /* TemplateLanguageInquiry */\n ]: \"Select preferred language\",\n [\n 31\n /* TemplateFrameworkInquiry */\n ]: \"Select preferred framework template\",\n [\n 13\n /* DevServerPortDescription */\n ]: \"The port that the dev server should use.\",\n [\n 14\n /* DevServerLoggingDescription */\n ]: \"Whether the dev server and browser console should output more log information or not (false).\",\n [\n 1\n /* ApiGatewayPortDescription */\n ]: \"The port that the api gateway should use.\",\n [\n 2\n /* ApiServerModeDescription */\n ]: \"Which components to start. [server|server-proxy|server-gateway].\",\n [\n 12\n /* DevServerOpenDescription */\n ]: \"Whether the dev server should automatically open in your browser or not.\",\n [\n 9\n /* BuildWatchDescription */\n ]: \"Whether the build should start watching and rebuild when files change or not.\",\n [\n 5\n /* AppEntryBuildOptionDescription */\n ]: \"The entry file for the app (./src/app).\",\n [\n 17\n /* ManifestEntryBuildOptionDescription */\n ]: \"The entry file for the app manifest (./src/manifest).\",\n [\n 8\n /* BuildModeOptionDescription */\n ]: \"Which mode to use when building the app.\",\n [\n 16\n /* FetchPackageVersionError */\n ]: \"Failed to fetch package info from the NPM registry for package '${0}'!\",\n [\n 20\n /* NoAppNameFound */\n ]: \"Could not find app name in manifest.\",\n [\n 3\n /* AppConfigurationPath */\n ]: \"The path to the app configuration file.\",\n [\n 27\n /* ServerMode */\n ]: \"Server\",\n [\n 29\n /* ServerProxyMode */\n ]: \"Server with proxy\",\n [\n 26\n /* ServerGatewayMode */\n ]: \"Server with gateway\"\n}, u = class {\n};\nlet c = u;\na(c, \"getTranslations\", () => M), a(c, \"getTranslation\", (t, ...r) => {\n const n = u.getTranslations()[t];\n if (!n)\n throw new Error(`Could not find text with given key '${t}'.`);\n return r.reduce(\n (p, h, g) => p.toString().replace(`{${g}}`, h.toString()),\n n\n ).toString();\n}), a(c, \"get\", (t = s.MissingTranslationKey, ...r) => u.getTranslation(t, ...r));\nfunction R(e, t) {\n return y(Object.values(e), ({ name: r }) => ({\n label: r,\n value: r,\n selected: t === r\n }));\n}\nvar O = /* @__PURE__ */ ((e) => (e.Primary = \"primary\", e.Secondary = \"secondary\", e.Expressive = \"expressive\", e.Destructive = \"destructive\", e.Text = \"text\", e.PrimaryWhite = \"primary-white\", e.SecondaryWhite = \"secondary-white\", e.ExpressiveWhite = \"expressive-white\", e.TertiaryPurple = \"tertiary-purple\", e))(O || {});\nfunction $(e, t) {\n return Object.values(e).find((i) => i.name === t);\n}\nfunction y(e, t) {\n return e.reduce(\n (r, i) => (r.push({\n disabled: !1,\n selected: !1,\n ...t(i)\n }), r),\n [\n {\n label: \"Choose...\",\n value: \"\",\n disabled: !0,\n selected: !0\n }\n ]\n );\n}\nfunction U(e) {\n return (t) => {\n t.key === \"Enter\" && e(t);\n };\n}\nfunction L(e, t = \"all\") {\n const { email: r, displayName: i } = e, n = i && i !== \"unknown\", o = !!r;\n switch (t) {\n case \"all\": {\n if (n && o)\n return `${i} (${r})`;\n if (n)\n return i;\n if (o)\n return r;\n }\n case \"single\": {\n if (n)\n return i;\n if (o)\n return r;\n }\n }\n return \"<UNKNOWN USER>\";\n}\nfunction j(...e) {\n return e.filter((t) => !!t).join(\" \");\n}\nexport {\n C as AllianceError,\n N as FrameworkErrorCodes,\n c as Texts,\n s as TranslationsKey,\n A as UtilitiesErrorCodes,\n O as VocaButtonVariant,\n j as classNames,\n k as createCapabilityPath,\n L as friendlyUserName,\n W as getCurrentLocationInfo,\n l as getRuntimeRootUrl,\n $ as getVocaIcon,\n I as isAllianceError,\n y as mapToVocaOptions,\n U as onEnter,\n P as setRuntimeRootUrl,\n R as vocaIconsToOptions\n};\n//# sourceMappingURL=index.js.map\n","import {\n SerializeableObject,\n createCapabilityPath,\n onEnter,\n} from '@telia-ace/alliance-internal-client-utilities';\nimport { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nfunction isOnCurrentPath(path: string = '') {\n const cleanedPath = location.href.replace(location.origin, '');\n return cleanedPath.startsWith(path);\n}\n\n@customElement('alliance-link')\nexport class Link extends LitElement {\n @property({ type: String, attribute: true, reflect: true })\n capability: string = '';\n\n @property({ type: String, attribute: true, reflect: true })\n app: string = '';\n\n @property({ type: Object, attribute: true, reflect: true })\n args: SerializeableObject = {};\n\n /**\n * Link properties\n */\n @property({ type: String, attribute: true, reflect: true })\n href?: string;\n\n @property({ type: String })\n target?: string;\n\n @property({ type: String, attribute: true, reflect: true })\n rel?: string;\n\n @property({ type: String, attribute: true, reflect: true })\n download?: string;\n\n navigate = () => {\n history.pushState(this.args, '', this._href);\n window.dispatchEvent(new Event('popstate'));\n };\n\n clickHandler = (event: MouseEvent) => {\n if (this.href || this.download) {\n return;\n }\n\n event.preventDefault();\n\n this.navigate();\n };\n\n updateActive = () => {\n this.active = isOnCurrentPath(this._href);\n };\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('popstate', this.updateActive);\n this.computeHref();\n }\n\n disconnectedCallback() {\n window.removeEventListener('popstate', this.updateActive);\n super.disconnectedCallback();\n }\n\n attributeChangedCallback(_1: string, _2: string | null, _3: string | null) {\n super.attributeChangedCallback(_1, _2, _3);\n\n // FUTURE TODO: Try to figure out this timeout is needed\n // Update seems to happen too early if this is not timed\n setTimeout(() => this.computeHref());\n }\n\n /**\n * Internal properties\n */\n @property({ type: String, attribute: false, reflect: false })\n private _href: string = '';\n\n @property({ type: Boolean, attribute: 'active', reflect: true })\n private active: boolean = false;\n\n private computeHref = () => {\n if (this.href) {\n return (this._href = this.href);\n }\n\n if (!this.app) {\n throw new Error('The app property is required when creating a capability link!');\n }\n this._href = createCapabilityPath(this.app, this.capability, this.args);\n this.updateActive();\n };\n\n render() {\n return html`<a\n part=\"anchor\"\n target=${this.target}\n rel=${this.rel}\n download=${this.download}\n .href=${this._href}\n ?active=${this.active}\n @click=${this.clickHandler}\n @keydown=${onEnter(this.clickHandler)}\n >\n <slot></slot>\n </a>`;\n }\n}\n"],"names":["f","v","a","D","r","i","n","o","p","k","l","s","M","u","c","t","h","g","U","isOnCurrentPath","path","Link","LitElement","event","createCapabilityPath","_1","_2","_3","html","onEnter","__decorateClass","property","customElement"],"mappings":";AAAA,IAAIA,IAAI,OAAO,gBACXC,IAAI,CAAC,GAAG,GAAG,MAAM,KAAK,IAAID,EAAE,GAAG,GAAG,EAAE,YAAY,IAAI,cAAc,IAAI,UAAU,IAAI,OAAO,EAAC,CAAE,IAAI,EAAE,CAAC,IAAI,GACzGE,IAAI,CAAC,GAAG,GAAG,OAAOD,EAAE,GAAG,OAAO,KAAK,WAAW,IAAI,KAAK,GAAG,CAAC,GAAG;AAmFlE,SAASE,EAAE,GAAG;AACZ,QAAMC,IAAI,OAAO,QAAQ,CAAC,EAAE,OAAO,CAACC,GAAGC,MAAM;AAC3C,UAAM,CAACC,GAAGC,CAAC,IAAIF;AACf,WAAO,OAAOE,IAAI,QAAQ,OAAOA,KAAK,YAAYA,MAAM,OAAOH,EAAEE,CAAC,IAAI,KAAK,UAAUC,CAAC,IAAIH,EAAEE,CAAC,IAAIC,IAAIH;AAAA,EACtG,GAAE,CAAE,CAAA;AACL,SAAO,OAAO,KAAKD,CAAC,EAAE,SAAS,IAAI,IAA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Q,WAAW,IAAM,SAAS,IAAM;AAAA,GAnBjDV,EAoBT,WAAA,OAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,IAAM,SAAS,IAAM;AAAA,GAtBjDV,EAuBT,WAAA,YAAA,CAAA;AA4CQS,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,QAAQ,WAAW,IAAO,SAAS,IAAO;AAAA,GAlEnDV,EAmED,WAAA,SAAA,CAAA;AAGAS,EAAA;AAAA,EADPC,EAAS,EAAE,MAAM,SAAS,WAAW,UAAU,SAAS,IAAM;AAAA,GArEtDV,EAsED,WAAA,UAAA,CAAA;AAtECA,IAANS,EAAA;AAAA,EADNE,EAAc,eAAe;AAAA,GACjBX,CAAA;"}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { i as y, r as e, e as d, s as $, x as s, a as f } from "./query-assigned-elements-024d0918.js";
|
|
2
|
-
import { t as m, c as v } from "./repeat-600d2fb9.js";
|
|
3
|
-
import "./telia-button2-7783c019.js";
|
|
4
|
-
import "./telia-heading2-38ae44ae.js";
|
|
5
|
-
import "./telia-icon2-d0e7c715.js";
|
|
6
|
-
import { l as b, c as l, b as p, s as w, a as k, d as t } from "./index-d925c796.js";
|
|
7
|
-
import { c as x } from "./close-7d423291.js";
|
|
8
|
-
var S = Object.defineProperty, C = Object.getOwnPropertyDescriptor, r = (i, n, h, c) => {
|
|
9
|
-
for (var a = c > 1 ? void 0 : c ? C(n, h) : n, u = i.length - 1, g; u >= 0; u--)
|
|
10
|
-
(g = i[u]) && (a = (c ? g(n, h, a) : g(a)) || a);
|
|
11
|
-
return c && a && S(n, h, a), a;
|
|
12
|
-
};
|
|
13
|
-
let o = class extends $ {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments), this.header = "", this.actions = [], this.required = !1, this.scrollMode = "outside", this.hasSubHeader = !1, this.containStyling = () => this.contain ? s`<style>
|
|
16
|
-
:host {
|
|
17
|
-
height: 500px;
|
|
18
|
-
position: static;
|
|
19
|
-
}
|
|
20
|
-
.backdrop {
|
|
21
|
-
position: absolute;
|
|
22
|
-
}
|
|
23
|
-
</style>` : s`<style>
|
|
24
|
-
:host {
|
|
25
|
-
position: fixed;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.backdrop {
|
|
29
|
-
position: absolute;
|
|
30
|
-
}
|
|
31
|
-
</style>`, this.scrollStyling = () => this.scrollMode === "inside" ? s`<style>
|
|
32
|
-
.container {
|
|
33
|
-
align-items: center;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
dialog {
|
|
37
|
-
max-height: 80%;
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.body {
|
|
43
|
-
flex: 1;
|
|
44
|
-
padding: ${e(t.spacing24)} ${e(t.spacing32)};
|
|
45
|
-
height: 80%;
|
|
46
|
-
overflow-x: hidden;
|
|
47
|
-
overflow-y: auto;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.footer {
|
|
51
|
-
border-top: ${e(p.widthXs)} solid ${e(l.gray200)};
|
|
52
|
-
padding: ${e(t.spacing24)} ${e(t.spacing32)};
|
|
53
|
-
}
|
|
54
|
-
</style>` : s`<style>
|
|
55
|
-
.container {
|
|
56
|
-
overflow-x: hidden;
|
|
57
|
-
overflow-y: overlay;
|
|
58
|
-
align-items: flex-start;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
dialog {
|
|
62
|
-
display: block;
|
|
63
|
-
margin: ${e(t.spacing128)} ${e(t.spacing24)};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.footer,
|
|
67
|
-
.body {
|
|
68
|
-
margin: ${e(t.spacing24)} 0;
|
|
69
|
-
padding: 0 ${e(t.spacing32)};
|
|
70
|
-
}
|
|
71
|
-
</style>`, this.subHeaderStyling = () => {
|
|
72
|
-
if (this.hasSubHeader)
|
|
73
|
-
return s`<style>
|
|
74
|
-
div.sub-header {
|
|
75
|
-
display: block;
|
|
76
|
-
}
|
|
77
|
-
</style>`;
|
|
78
|
-
}, this.closeButton = () => this.required ? "" : s`<telia-button size="sm" variant="text" @click=${this.onCloseClick}
|
|
79
|
-
><telia-icon size="md" svg="${x.svg}"
|
|
80
|
-
/></telia-button>`, this.footer = () => this.actions.length ? s`
|
|
81
|
-
<div class="footer">
|
|
82
|
-
${v(
|
|
83
|
-
this.actions,
|
|
84
|
-
(i) => s`
|
|
85
|
-
<telia-button
|
|
86
|
-
disabled="${i.disabled ? "true" : "false"}"
|
|
87
|
-
variant="${i.variant || "primary"}"
|
|
88
|
-
size="sm"
|
|
89
|
-
@click=${() => this.action(i.action)}
|
|
90
|
-
>
|
|
91
|
-
${i.label}
|
|
92
|
-
</telia-button>
|
|
93
|
-
`
|
|
94
|
-
)}
|
|
95
|
-
</div>
|
|
96
|
-
` : "", this.onBackdropClick = () => {
|
|
97
|
-
if (!this.required)
|
|
98
|
-
return this.action("close");
|
|
99
|
-
}, this.onCloseClick = () => {
|
|
100
|
-
if (!this.required)
|
|
101
|
-
return this.action("close");
|
|
102
|
-
}, this.onKeyDown = (i) => {
|
|
103
|
-
i.defaultPrevented || !this.required && i.key === "Escape" && this.action("close");
|
|
104
|
-
}, this.onSubHeaderSlotChange = () => {
|
|
105
|
-
this.hasSubHeader = !0;
|
|
106
|
-
}, this.action = (i) => {
|
|
107
|
-
const n = new CustomEvent("action", {
|
|
108
|
-
bubbles: !0,
|
|
109
|
-
composed: !0,
|
|
110
|
-
detail: { action: i },
|
|
111
|
-
cancelable: !0
|
|
112
|
-
});
|
|
113
|
-
return this.dispatchEvent(n);
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
connectedCallback() {
|
|
117
|
-
super.connectedCallback(), window.addEventListener("keydown", this.onKeyDown);
|
|
118
|
-
}
|
|
119
|
-
disconnectedCallback() {
|
|
120
|
-
window.removeEventListener("keydown", this.onKeyDown), super.disconnectedCallback();
|
|
121
|
-
}
|
|
122
|
-
render() {
|
|
123
|
-
return s`
|
|
124
|
-
${this.containStyling()} ${this.scrollStyling()} ${this.subHeaderStyling()}
|
|
125
|
-
<div class="backdrop" @click=${this.onBackdropClick}></div>
|
|
126
|
-
<div class="container">
|
|
127
|
-
<dialog open>
|
|
128
|
-
<div class="header">
|
|
129
|
-
<telia-heading tag="h3" variant="title-100">${this.header}</telia-heading>
|
|
130
|
-
${this.closeButton()}
|
|
131
|
-
</div>
|
|
132
|
-
<div class="sub-header">
|
|
133
|
-
<slot name="sub-header" @slotchange=${this.onSubHeaderSlotChange}></slot>
|
|
134
|
-
</div>
|
|
135
|
-
<div class="body">
|
|
136
|
-
<slot></slot>
|
|
137
|
-
</div>
|
|
138
|
-
${this.footer()}
|
|
139
|
-
</dialog>
|
|
140
|
-
</div>
|
|
141
|
-
`;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
o.styles = y`
|
|
145
|
-
:host {
|
|
146
|
-
display: block;
|
|
147
|
-
inset: 0;
|
|
148
|
-
z-index: ${e(parseInt(b.modal) - 2)};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.backdrop {
|
|
152
|
-
inset: 0;
|
|
153
|
-
z-index: ${e(parseInt(b.modal) - 1)};
|
|
154
|
-
background-color: ${e(l.black)};
|
|
155
|
-
opacity: 0.3;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.container {
|
|
159
|
-
margin: 0 auto;
|
|
160
|
-
display: flex;
|
|
161
|
-
justify-content: center;
|
|
162
|
-
height: 100%;
|
|
163
|
-
width: 100%;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
dialog {
|
|
167
|
-
background-color: ${e(l.white)};
|
|
168
|
-
border-radius: ${e(p.radiusLg)};
|
|
169
|
-
box-shadow: ${e(w.md)};
|
|
170
|
-
z-index: ${e(parseInt(b.modal))};
|
|
171
|
-
max-width: ${e(k.breakpointLg)};
|
|
172
|
-
position: static;
|
|
173
|
-
padding: 0;
|
|
174
|
-
border: none;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.header {
|
|
178
|
-
position: relative;
|
|
179
|
-
display: flex;
|
|
180
|
-
align-items: center;
|
|
181
|
-
padding: ${e(t.spacing24)} ${e(t.spacing32)};
|
|
182
|
-
border-bottom: ${e(p.widthXs)} solid ${e(l.gray200)};
|
|
183
|
-
min-height: 40px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.header telia-button {
|
|
187
|
-
position: absolute;
|
|
188
|
-
top: ${e(t.spacing20)};
|
|
189
|
-
right: ${e(t.spacing24)};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.sub-header {
|
|
193
|
-
padding: ${e(t.spacing24)} ${e(t.spacing32)};
|
|
194
|
-
border-bottom: ${e(p.widthXs)} solid ${e(l.gray200)};
|
|
195
|
-
display: none;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.body {
|
|
199
|
-
min-width: calc(${e(t.spacing128)} * 2);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.footer {
|
|
203
|
-
display: flex;
|
|
204
|
-
justify-content: flex-end;
|
|
205
|
-
gap: ${e(t.spacing16)};
|
|
206
|
-
}
|
|
207
|
-
`;
|
|
208
|
-
r([
|
|
209
|
-
d({ type: String, attribute: "header" })
|
|
210
|
-
], o.prototype, "header", 2);
|
|
211
|
-
r([
|
|
212
|
-
d({ type: Array })
|
|
213
|
-
], o.prototype, "actions", 2);
|
|
214
|
-
r([
|
|
215
|
-
d({ type: Boolean, attribute: "required" })
|
|
216
|
-
], o.prototype, "required", 2);
|
|
217
|
-
r([
|
|
218
|
-
d({ type: String, attribute: "scroll-mode" })
|
|
219
|
-
], o.prototype, "scrollMode", 2);
|
|
220
|
-
r([
|
|
221
|
-
m()
|
|
222
|
-
], o.prototype, "hasSubHeader", 2);
|
|
223
|
-
r([
|
|
224
|
-
d({ type: Boolean, attribute: "contain" })
|
|
225
|
-
], o.prototype, "contain", 2);
|
|
226
|
-
o = r([
|
|
227
|
-
f("alliance-modal")
|
|
228
|
-
], o);
|
|
229
|
-
//# sourceMappingURL=alliance-modal-1126a4c4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alliance-modal-1126a4c4.js","sources":["../src/components/alliance-modal/alliance-modal.ts"],"sourcesContent":["import type { ButtonVariantType } from '@teliads/components/dist/types/types/ButtonVariant';\nimport { css, html, LitElement, unsafeCSS } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\n\nimport '@/voca/components/telia-button';\nimport '@/voca/components/telia-heading';\nimport '@/voca/components/telia-icon';\nimport { borders, breakpoints, colors, layers, shadows, spacing } from '@/voca/foundations';\nimport { close } from '@/voca/icons';\n\nexport type Action = {\n variant: ButtonVariantType;\n label: string;\n action: string;\n disabled?: boolean;\n};\n\n/**\n * Event dispatched when clicking the close button, the backdrop, an action button or pressing escape.\n *\n * Event: `action`\n *\n * Detail: Object containing the property `action`.\n */\nexport type ActionEvent = CustomEvent<{ action: string }>;\n\n@customElement('alliance-modal')\nexport class Modal extends LitElement {\n static styles = css`\n :host {\n display: block;\n inset: 0;\n z-index: ${unsafeCSS(parseInt(layers.modal) - 2)};\n }\n\n .backdrop {\n inset: 0;\n z-index: ${unsafeCSS(parseInt(layers.modal) - 1)};\n background-color: ${unsafeCSS(colors.black)};\n opacity: 0.3;\n }\n\n .container {\n margin: 0 auto;\n display: flex;\n justify-content: center;\n height: 100%;\n width: 100%;\n }\n\n dialog {\n background-color: ${unsafeCSS(colors.white)};\n border-radius: ${unsafeCSS(borders.radiusLg)};\n box-shadow: ${unsafeCSS(shadows.md)};\n z-index: ${unsafeCSS(parseInt(layers.modal))};\n max-width: ${unsafeCSS(breakpoints.breakpointLg)};\n position: static;\n padding: 0;\n border: none;\n }\n\n .header {\n position: relative;\n display: flex;\n align-items: center;\n padding: ${unsafeCSS(spacing.spacing24)} ${unsafeCSS(spacing.spacing32)};\n border-bottom: ${unsafeCSS(borders.widthXs)} solid ${unsafeCSS(colors.gray200)};\n min-height: 40px;\n }\n\n .header telia-button {\n position: absolute;\n top: ${unsafeCSS(spacing.spacing20)};\n right: ${unsafeCSS(spacing.spacing24)};\n }\n\n .sub-header {\n padding: ${unsafeCSS(spacing.spacing24)} ${unsafeCSS(spacing.spacing32)};\n border-bottom: ${unsafeCSS(borders.widthXs)} solid ${unsafeCSS(colors.gray200)};\n display: none;\n }\n\n .body {\n min-width: calc(${unsafeCSS(spacing.spacing128)} * 2);\n }\n\n .footer {\n display: flex;\n justify-content: flex-end;\n gap: ${unsafeCSS(spacing.spacing16)};\n }\n `;\n\n @property({ type: String, attribute: 'header' })\n header: string = '';\n\n @property({ type: Array })\n actions: Action[] = [];\n\n @property({ type: Boolean, attribute: 'required' })\n required: boolean = false;\n\n @property({ type: String, attribute: 'scroll-mode' })\n scrollMode: 'outside' | 'inside' = 'outside';\n\n @state()\n hasSubHeader: boolean = false;\n\n // Internal usage only\n // Used in Storybook to contain modal in story\n @property({ type: Boolean, attribute: 'contain' })\n contain?: boolean;\n\n containStyling = () => {\n if (!this.contain) {\n return html`<style>\n :host {\n position: fixed;\n }\n\n .backdrop {\n position: absolute;\n }\n </style>`;\n }\n\n return html`<style>\n :host {\n height: 500px;\n position: static;\n }\n .backdrop {\n position: absolute;\n }\n </style>`;\n };\n\n scrollStyling = () => {\n if (this.scrollMode === 'inside') {\n return html`<style>\n .container {\n align-items: center;\n }\n\n dialog {\n max-height: 80%;\n display: flex;\n flex-direction: column;\n }\n\n .body {\n flex: 1;\n padding: ${unsafeCSS(spacing.spacing24)} ${unsafeCSS(spacing.spacing32)};\n height: 80%;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .footer {\n border-top: ${unsafeCSS(borders.widthXs)} solid ${unsafeCSS(colors.gray200)};\n padding: ${unsafeCSS(spacing.spacing24)} ${unsafeCSS(spacing.spacing32)};\n }\n </style>`;\n }\n\n return html`<style>\n .container {\n overflow-x: hidden;\n overflow-y: overlay;\n align-items: flex-start;\n }\n\n dialog {\n display: block;\n margin: ${unsafeCSS(spacing.spacing128)} ${unsafeCSS(spacing.spacing24)};\n }\n\n .footer,\n .body {\n margin: ${unsafeCSS(spacing.spacing24)} 0;\n padding: 0 ${unsafeCSS(spacing.spacing32)};\n }\n </style>`;\n };\n\n subHeaderStyling = () => {\n if (this.hasSubHeader) {\n return html`<style>\n div.sub-header {\n display: block;\n }\n </style>`;\n }\n };\n\n closeButton = () => {\n if (this.required) {\n return '';\n }\n\n return html`<telia-button size=\"sm\" variant=\"text\" @click=${this.onCloseClick}\n ><telia-icon size=\"md\" svg=\"${close.svg}\"\n /></telia-button>`;\n };\n\n footer = () => {\n if (!this.actions.length) {\n return '';\n }\n\n return html`\n <div class=\"footer\">\n ${repeat(\n this.actions,\n (action) => html`\n <telia-button\n disabled=\"${action.disabled ? 'true' : 'false'}\"\n variant=\"${action.variant || 'primary'}\"\n size=\"sm\"\n @click=${() => this.action(action.action)}\n >\n ${action.label}\n </telia-button>\n `\n )}\n </div>\n `;\n };\n\n onBackdropClick = () => {\n if (this.required) {\n return;\n }\n\n return this.action('close');\n };\n\n onCloseClick = () => {\n if (this.required) {\n return;\n }\n\n return this.action('close');\n };\n\n onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented) {\n return;\n }\n\n if (!this.required && event.key === 'Escape') {\n this.action('close');\n }\n };\n\n // The slotchange event is only triggered if slot changes content\n // So if event is triggered, that means sub-header is populated and should be shown\n onSubHeaderSlotChange = () => {\n this.hasSubHeader = true;\n };\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('keydown', this.onKeyDown);\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this.onKeyDown);\n super.disconnectedCallback();\n }\n\n action = (action: string) => {\n const event: ActionEvent = new CustomEvent('action', {\n bubbles: true,\n composed: true,\n detail: { action },\n cancelable: true,\n });\n return this.dispatchEvent(event);\n };\n\n render() {\n return html`\n ${this.containStyling()} ${this.scrollStyling()} ${this.subHeaderStyling()}\n <div class=\"backdrop\" @click=${this.onBackdropClick}></div>\n <div class=\"container\">\n <dialog open>\n <div class=\"header\">\n <telia-heading tag=\"h3\" variant=\"title-100\">${this.header}</telia-heading>\n ${this.closeButton()}\n </div>\n <div class=\"sub-header\">\n <slot name=\"sub-header\" @slotchange=${this.onSubHeaderSlotChange}></slot>\n </div>\n <div class=\"body\">\n <slot></slot>\n </div>\n ${this.footer()}\n </dialog>\n </div>\n `;\n }\n}\n"],"names":["Modal","LitElement","html","unsafeCSS","spacing","borders","colors","close","repeat","action","event","css","layers","shadows","breakpoints","__decorateClass","property","state","customElement"],"mappings":";;;;;;;;;;;;AA4Ba,IAAAA,IAAN,cAAoBC,EAAW;AAAA,EAA/B,cAAA;AAAA,UAAA,GAAA,SAAA,GAmEc,KAAA,SAAA,IAGjB,KAAA,UAAoB,IAGA,KAAA,WAAA,IAGe,KAAA,aAAA,WAGX,KAAA,eAAA,IAOxB,KAAA,iBAAiB,MACR,KAAK,UAYHC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,oBAXIA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,uBAsBf,KAAA,gBAAgB,MACR,KAAK,eAAe,WACbA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,+BAaYC,EAAUC,EAAQ,SAAS,KAAKD,EAAUC,EAAQ,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAOxDD,EAAUE,EAAQ,OAAO,WAAWF,EAAUG,EAAO,OAAO;AAAA,+BAC/DH,EAAUC,EAAQ,SAAS,KAAKD,EAAUC,EAAQ,SAAS;AAAA;AAAA,wBAK3EF;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,0BASWC,EAAUC,EAAQ,UAAU,KAAKD,EAAUC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