@arcgis/common-components 4.29.0-beta.5 → 4.29.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +1 -1
  2. package/dist/arcgis-common-components/arcgis-common-components.esm.js +1 -1
  3. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.ar.json +78 -0
  4. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.bg.json +78 -0
  5. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.bs.json +78 -0
  6. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.ca.json +78 -0
  7. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.cs.json +78 -0
  8. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.da.json +78 -0
  9. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.de.json +78 -0
  10. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.el.json +78 -0
  11. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.en.json +78 -0
  12. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.es.json +78 -0
  13. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.et.json +78 -0
  14. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.fi.json +78 -0
  15. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.fr.json +78 -0
  16. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.he.json +78 -0
  17. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.hr.json +78 -0
  18. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.hu.json +78 -0
  19. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.id.json +78 -0
  20. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.it.json +78 -0
  21. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.ja.json +78 -0
  22. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.ko.json +78 -0
  23. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.lt.json +78 -0
  24. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.lv.json +78 -0
  25. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.nb.json +78 -0
  26. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.nl.json +78 -0
  27. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.pl.json +78 -0
  28. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.pt-BR.json +78 -0
  29. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.pt-PT.json +78 -0
  30. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.ro.json +78 -0
  31. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.ru.json +78 -0
  32. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.sk.json +78 -0
  33. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.sl.json +78 -0
  34. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.sr.json +78 -0
  35. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.sv.json +78 -0
  36. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.th.json +78 -0
  37. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.tr.json +78 -0
  38. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.uk.json +78 -0
  39. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.vi.json +78 -0
  40. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.zh-CN.json +78 -0
  41. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.zh-HK.json +78 -0
  42. package/dist/arcgis-common-components/assets/field-info/t9n/field-info.t9n.zh-TW.json +78 -0
  43. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.ar.json +17 -0
  44. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.bg.json +17 -0
  45. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.bs.json +17 -0
  46. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.ca.json +17 -0
  47. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.cs.json +17 -0
  48. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.da.json +17 -0
  49. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.de.json +17 -0
  50. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.el.json +17 -0
  51. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.en.json +17 -0
  52. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.es.json +17 -0
  53. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.et.json +17 -0
  54. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.fi.json +17 -0
  55. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.fr.json +17 -0
  56. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.he.json +17 -0
  57. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.hr.json +17 -0
  58. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.hu.json +17 -0
  59. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.id.json +17 -0
  60. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.it.json +17 -0
  61. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.ja.json +17 -0
  62. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.ko.json +17 -0
  63. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.lt.json +17 -0
  64. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.lv.json +17 -0
  65. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.nb.json +17 -0
  66. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.nl.json +17 -0
  67. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.pl.json +17 -0
  68. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.pt-BR.json +17 -0
  69. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.pt-PT.json +17 -0
  70. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.ro.json +17 -0
  71. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.ru.json +17 -0
  72. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.sk.json +17 -0
  73. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.sl.json +17 -0
  74. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.sr.json +17 -0
  75. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.sv.json +17 -0
  76. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.th.json +17 -0
  77. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.tr.json +17 -0
  78. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.uk.json +17 -0
  79. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.vi.json +17 -0
  80. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.zh-CN.json +17 -0
  81. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.zh-HK.json +17 -0
  82. package/dist/arcgis-common-components/assets/field-pick-list/t9n/field-pick-list.t9n.zh-TW.json +17 -0
  83. package/dist/arcgis-common-components/p-6c7d2684.js +1 -0
  84. package/dist/arcgis-common-components/p-7318a1d1.entry.js +1 -0
  85. package/dist/arcgis-common-components/p-a91ab432.js +2 -0
  86. package/dist/arcgis-common-components/p-efab92a8.entry.js +1 -0
  87. package/dist/cjs/arcgis-common-components.cjs.js +3 -3
  88. package/dist/cjs/arcgis-field-info.cjs.entry.js +1025 -0
  89. package/dist/cjs/arcgis-field-pick-list.cjs.entry.js +245 -0
  90. package/dist/cjs/index-5ec7f592.js +90 -0
  91. package/dist/cjs/index-e0422bc8.js +1887 -0
  92. package/dist/cjs/loader.cjs.js +3 -12
  93. package/dist/components/{arcgis-api-key.d.ts → arcgis-field-info.d.ts} +4 -4
  94. package/dist/components/arcgis-field-info.js +6 -0
  95. package/dist/components/{arcgis-identity.d.ts → arcgis-field-pick-list.d.ts} +4 -4
  96. package/dist/components/arcgis-field-pick-list.js +301 -0
  97. package/dist/components/field-info.js +1108 -0
  98. package/dist/components/index.d.ts +5 -4
  99. package/dist/components/index.js +1 -3
  100. package/dist/esm/arcgis-common-components.js +4 -4
  101. package/dist/esm/arcgis-field-info.entry.js +1021 -0
  102. package/dist/esm/arcgis-field-pick-list.entry.js +241 -0
  103. package/dist/esm/index-0c129ec4.js +1856 -0
  104. package/dist/esm/index-ba4fe890.js +59 -0
  105. package/dist/esm/loader.js +4 -13
  106. package/dist/loader/index.d.ts +2 -2
  107. package/dist/types/components/field-info/field-info.d.ts +68 -0
  108. package/dist/types/components/field-info/t9n-types.d.ts +82 -0
  109. package/dist/types/components/field-info/utils/basic.d.ts +44 -0
  110. package/dist/types/components/field-info/utils/feature.d.ts +17 -0
  111. package/dist/types/components/field-info/utils/field.d.ts +25 -0
  112. package/dist/types/components/field-info/utils/index.d.ts +3 -0
  113. package/dist/types/components/field-pick-list/field-pick-list.d.ts +122 -0
  114. package/dist/types/components/field-pick-list/t9n-types.d.ts +17 -0
  115. package/dist/types/components/field-pick-list/utils/types.d.ts +25 -0
  116. package/dist/types/components.d.ts +258 -49
  117. package/dist/types/stencil-public-runtime.d.ts +61 -17
  118. package/package.json +24 -26
  119. package/dist/arcgis-common-components/p-3768a3bb.entry.js +0 -1
  120. package/dist/arcgis-common-components/p-84fccaad.entry.js +0 -1
  121. package/dist/arcgis-common-components/p-9625972e.js +0 -1
  122. package/dist/arcgis-common-components/p-b0c98bba.js +0 -2
  123. package/dist/cjs/arcgis-api-key.cjs.entry.js +0 -51
  124. package/dist/cjs/arcgis-identity.cjs.entry.js +0 -139
  125. package/dist/cjs/index-e8c59179.js +0 -858
  126. package/dist/cjs/index-f1a937af.js +0 -65
  127. package/dist/components/arcgis-api-key.js +0 -67
  128. package/dist/components/arcgis-identity.js +0 -165
  129. package/dist/components/index2.js +0 -40
  130. package/dist/esm/arcgis-api-key.entry.js +0 -47
  131. package/dist/esm/arcgis-identity.entry.js +0 -135
  132. package/dist/esm/index-1f7e8e45.js +0 -831
  133. package/dist/esm/index-71b437b1.js +0 -40
  134. package/dist/esm/polyfills/css-shim.js +0 -1
  135. package/dist/types/components/arcgis-api-key/arcgis-api-key.d.ts +0 -9
  136. package/dist/types/components/arcgis-identity/arcgis-identity.d.ts +0 -31
  137. package/dist/types/components/types.d.ts +0 -10
@@ -1,65 +0,0 @@
1
- 'use strict';
2
-
3
- function _interopNamespace(e) {
4
- if (e && e.__esModule) return e;
5
- var n = Object.create(null);
6
- if (e) {
7
- Object.keys(e).forEach(function (k) {
8
- if (k !== 'default') {
9
- var d = Object.getOwnPropertyDescriptor(e, k);
10
- Object.defineProperty(n, k, d.get ? d : {
11
- enumerable: true,
12
- get: function () {
13
- return e[k];
14
- }
15
- });
16
- }
17
- });
18
- }
19
- n['default'] = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- const amd = "define" in window && typeof window.define === "function" && "amd" in window.define;
24
- function requireModule(modulePath) {
25
- return new Promise((resolve) => window.require([modulePath], (moduleDefault) => {
26
- resolve(moduleDefault);
27
- }));
28
- }
29
- async function importIdentityIdentityManager() {
30
- if (amd) {
31
- return requireModule("esri/identity/IdentityManager");
32
- }
33
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/identity/IdentityManager.js')); });
34
- return module.default;
35
- }
36
- async function importIdentityOAuthInfo() {
37
- if (amd) {
38
- return requireModule("esri/identity/OAuthInfo");
39
- }
40
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/identity/OAuthInfo.js')); });
41
- return module.default;
42
- }
43
- async function newIdentityOAuthInfo(properties) {
44
- const ModConstructor = await importIdentityOAuthInfo();
45
- return new ModConstructor(properties);
46
- }
47
- async function importConfig() {
48
- if (amd) {
49
- return requireModule("esri/config");
50
- }
51
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/config.js')); });
52
- return module.default;
53
- }
54
- async function importCoreReactiveUtils() {
55
- if (amd) {
56
- return requireModule("esri/core/reactiveUtils");
57
- }
58
- const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/core/reactiveUtils.js')); });
59
- return module;
60
- }
61
-
62
- exports.importConfig = importConfig;
63
- exports.importCoreReactiveUtils = importCoreReactiveUtils;
64
- exports.importIdentityIdentityManager = importIdentityIdentityManager;
65
- exports.newIdentityOAuthInfo = newIdentityOAuthInfo;
@@ -1,67 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
2
- import { i as importConfig } from './index2.js';
3
-
4
- const arcgisApiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
5
-
6
- const ArcgisApiKey$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
- constructor() {
8
- super();
9
- this.__registerHost();
10
- this.apiKeyReady = createEvent(this, "apiKeyReady", 7);
11
- this.apiKey = undefined;
12
- }
13
- //--------------------------------------------------------------------------
14
- //
15
- // Watchers
16
- //
17
- //--------------------------------------------------------------------------
18
- apiKeyWatcher(value) {
19
- this._setApiKey(value);
20
- }
21
- //--------------------------------------------------------------------------
22
- //
23
- // Lifecycle
24
- //
25
- //--------------------------------------------------------------------------
26
- async connectedCallback() {
27
- if (this.apiKey) {
28
- await this._setApiKey(this.apiKey);
29
- }
30
- }
31
- //--------------------------------------------------------------------------
32
- //
33
- // Private Methods
34
- //
35
- //--------------------------------------------------------------------------
36
- async _setApiKey(value) {
37
- const config = await importConfig();
38
- config.apiKey = value;
39
- this.apiKeyReady.emit(true);
40
- }
41
- get el() { return this; }
42
- static get watchers() { return {
43
- "apiKey": ["apiKeyWatcher"]
44
- }; }
45
- static get style() { return arcgisApiKeyCss; }
46
- }, [0, "arcgis-api-key", {
47
- "apiKey": [1, "api-key"]
48
- }]);
49
- function defineCustomElement$1() {
50
- if (typeof customElements === "undefined") {
51
- return;
52
- }
53
- const components = ["arcgis-api-key"];
54
- components.forEach(tagName => { switch (tagName) {
55
- case "arcgis-api-key":
56
- if (!customElements.get(tagName)) {
57
- customElements.define(tagName, ArcgisApiKey$1);
58
- }
59
- break;
60
- } });
61
- }
62
- defineCustomElement$1();
63
-
64
- const ArcgisApiKey = ArcgisApiKey$1;
65
- const defineCustomElement = defineCustomElement$1;
66
-
67
- export { ArcgisApiKey, defineCustomElement };
@@ -1,165 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
2
- import { a as importCoreReactiveUtils, n as newIdentityOAuthInfo, b as importIdentityIdentityManager } from './index2.js';
3
-
4
- const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
5
-
6
- const ArcgisIdentity$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
- constructor() {
8
- super();
9
- this.__registerHost();
10
- this.identityReady = createEvent(this, "identityReady", 7);
11
- this.credentialCreate = createEvent(this, "credentialCreate", 7);
12
- this.dialogCreate = createEvent(this, "dialogCreate", 7);
13
- this.identity = undefined;
14
- this.appId = undefined;
15
- this.credential = undefined;
16
- this.expiration = undefined;
17
- this.locale = undefined;
18
- this.usePopup = false;
19
- this.popupCallbackUrl = undefined;
20
- this.portalUrl = undefined;
21
- this.preserveUrlHash = false;
22
- }
23
- //--------------------------------------------------------------------------
24
- //
25
- // Watchers
26
- //
27
- //--------------------------------------------------------------------------
28
- appIdWatcher(value, oldValue) {
29
- if (oldValue !== value) {
30
- this._registerOAuth();
31
- }
32
- }
33
- //--------------------------------------------------------------------------
34
- //
35
- // Methods
36
- //
37
- //--------------------------------------------------------------------------
38
- async signIn() {
39
- if (!this.credential) {
40
- try {
41
- this.credential = await this._checkCurrentStatus();
42
- }
43
- catch (error) {
44
- this.credential = await this._fetchCredential();
45
- }
46
- }
47
- return this.credential;
48
- }
49
- async signOut() {
50
- if (!this.credential) {
51
- try {
52
- this.identity.destroyCredentials();
53
- }
54
- catch (error) {
55
- this.credential = undefined;
56
- }
57
- }
58
- this.credential = undefined;
59
- return;
60
- }
61
- //--------------------------------------------------------------------------
62
- //
63
- // Lifecycle
64
- //
65
- //--------------------------------------------------------------------------
66
- async connectedCallback() {
67
- if (this.appId) {
68
- await this._registerOAuth();
69
- }
70
- this._proxyEvents();
71
- await this._addWatchers();
72
- this.identityReady.emit({ identity: this.identity, ready: true });
73
- }
74
- //--------------------------------------------------------------------------
75
- //
76
- // Private Methods
77
- //
78
- //--------------------------------------------------------------------------
79
- async _addWatchers() {
80
- const { watch } = await importCoreReactiveUtils();
81
- watch(() => this._info.expiration, (value) => (this.expiration = value), {
82
- initial: true
83
- });
84
- }
85
- _checkCurrentStatus() {
86
- return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`);
87
- }
88
- async _createOAuthInfo() {
89
- const params = {};
90
- if (this.appId !== undefined) {
91
- params.appId = this.appId;
92
- }
93
- if (this.locale !== undefined) {
94
- params.locale = this.locale;
95
- }
96
- if (this.popupCallbackUrl !== undefined) {
97
- params.popupCallbackUrl = this.popupCallbackUrl;
98
- }
99
- if (this.preserveUrlHash !== undefined) {
100
- params.preserveUrlHash = this.preserveUrlHash;
101
- }
102
- if (this.usePopup !== undefined) {
103
- params.popup = this.usePopup;
104
- }
105
- if (this.portalUrl !== undefined) {
106
- params.portalUrl = this.portalUrl;
107
- }
108
- const info = await newIdentityOAuthInfo(params);
109
- this._info = info;
110
- return info;
111
- }
112
- async _fetchCredential() {
113
- const credential = await this.identity.getCredential(`${this._info?.portalUrl}/sharing`, {
114
- error: null,
115
- oAuthPopupConfirmation: false,
116
- token: null
117
- });
118
- return credential;
119
- }
120
- async _registerOAuth() {
121
- this.identity = await importIdentityIdentityManager();
122
- const info = await this._createOAuthInfo();
123
- this.identity.registerOAuthInfos([info]);
124
- }
125
- _proxyEvents() {
126
- this.identity.on("credential-create", (e) => this.credentialCreate.emit(e));
127
- this.identity.on("dialog-create", (e) => this.dialogCreate.emit(e));
128
- }
129
- get el() { return this; }
130
- static get watchers() { return {
131
- "appId": ["appIdWatcher"]
132
- }; }
133
- static get style() { return arcgisIdentityCss; }
134
- }, [0, "arcgis-identity", {
135
- "identity": [1040],
136
- "appId": [1, "app-id"],
137
- "credential": [1040],
138
- "expiration": [1026],
139
- "locale": [1],
140
- "usePopup": [4, "use-popup"],
141
- "popupCallbackUrl": [1, "popup-callback-url"],
142
- "portalUrl": [1, "portal-url"],
143
- "preserveUrlHash": [4, "preserve-url-hash"],
144
- "signIn": [64],
145
- "signOut": [64]
146
- }]);
147
- function defineCustomElement$1() {
148
- if (typeof customElements === "undefined") {
149
- return;
150
- }
151
- const components = ["arcgis-identity"];
152
- components.forEach(tagName => { switch (tagName) {
153
- case "arcgis-identity":
154
- if (!customElements.get(tagName)) {
155
- customElements.define(tagName, ArcgisIdentity$1);
156
- }
157
- break;
158
- } });
159
- }
160
- defineCustomElement$1();
161
-
162
- const ArcgisIdentity = ArcgisIdentity$1;
163
- const defineCustomElement = defineCustomElement$1;
164
-
165
- export { ArcgisIdentity, defineCustomElement };
@@ -1,40 +0,0 @@
1
- const amd = "define" in window && typeof window.define === "function" && "amd" in window.define;
2
- function requireModule(modulePath) {
3
- return new Promise((resolve) => window.require([modulePath], (moduleDefault) => {
4
- resolve(moduleDefault);
5
- }));
6
- }
7
- async function importIdentityIdentityManager() {
8
- if (amd) {
9
- return requireModule("esri/identity/IdentityManager");
10
- }
11
- const module = await import('@arcgis/core/identity/IdentityManager.js');
12
- return module.default;
13
- }
14
- async function importIdentityOAuthInfo() {
15
- if (amd) {
16
- return requireModule("esri/identity/OAuthInfo");
17
- }
18
- const module = await import('@arcgis/core/identity/OAuthInfo.js');
19
- return module.default;
20
- }
21
- async function newIdentityOAuthInfo(properties) {
22
- const ModConstructor = await importIdentityOAuthInfo();
23
- return new ModConstructor(properties);
24
- }
25
- async function importConfig() {
26
- if (amd) {
27
- return requireModule("esri/config");
28
- }
29
- const module = await import('@arcgis/core/config.js');
30
- return module.default;
31
- }
32
- async function importCoreReactiveUtils() {
33
- if (amd) {
34
- return requireModule("esri/core/reactiveUtils");
35
- }
36
- const module = await import('@arcgis/core/core/reactiveUtils.js');
37
- return module;
38
- }
39
-
40
- export { importCoreReactiveUtils as a, importIdentityIdentityManager as b, importConfig as i, newIdentityOAuthInfo as n };
@@ -1,47 +0,0 @@
1
- import { r as registerInstance, c as createEvent, g as getElement } from './index-1f7e8e45.js';
2
- import { i as importConfig } from './index-71b437b1.js';
3
-
4
- const arcgisApiKeyCss = ":host{display:none}arcgis-api-key{display:none}";
5
-
6
- const ArcgisApiKey = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.apiKeyReady = createEvent(this, "apiKeyReady", 7);
10
- this.apiKey = undefined;
11
- }
12
- //--------------------------------------------------------------------------
13
- //
14
- // Watchers
15
- //
16
- //--------------------------------------------------------------------------
17
- apiKeyWatcher(value) {
18
- this._setApiKey(value);
19
- }
20
- //--------------------------------------------------------------------------
21
- //
22
- // Lifecycle
23
- //
24
- //--------------------------------------------------------------------------
25
- async connectedCallback() {
26
- if (this.apiKey) {
27
- await this._setApiKey(this.apiKey);
28
- }
29
- }
30
- //--------------------------------------------------------------------------
31
- //
32
- // Private Methods
33
- //
34
- //--------------------------------------------------------------------------
35
- async _setApiKey(value) {
36
- const config = await importConfig();
37
- config.apiKey = value;
38
- this.apiKeyReady.emit(true);
39
- }
40
- get el() { return getElement(this); }
41
- static get watchers() { return {
42
- "apiKey": ["apiKeyWatcher"]
43
- }; }
44
- };
45
- ArcgisApiKey.style = arcgisApiKeyCss;
46
-
47
- export { ArcgisApiKey as arcgis_api_key };
@@ -1,135 +0,0 @@
1
- import { r as registerInstance, c as createEvent, g as getElement } from './index-1f7e8e45.js';
2
- import { a as importCoreReactiveUtils, n as newIdentityOAuthInfo, b as importIdentityIdentityManager } from './index-71b437b1.js';
3
-
4
- const arcgisIdentityCss = ":host{display:none}arcgis-identity{display:none}";
5
-
6
- const ArcgisIdentity = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.identityReady = createEvent(this, "identityReady", 7);
10
- this.credentialCreate = createEvent(this, "credentialCreate", 7);
11
- this.dialogCreate = createEvent(this, "dialogCreate", 7);
12
- this.identity = undefined;
13
- this.appId = undefined;
14
- this.credential = undefined;
15
- this.expiration = undefined;
16
- this.locale = undefined;
17
- this.usePopup = false;
18
- this.popupCallbackUrl = undefined;
19
- this.portalUrl = undefined;
20
- this.preserveUrlHash = false;
21
- }
22
- //--------------------------------------------------------------------------
23
- //
24
- // Watchers
25
- //
26
- //--------------------------------------------------------------------------
27
- appIdWatcher(value, oldValue) {
28
- if (oldValue !== value) {
29
- this._registerOAuth();
30
- }
31
- }
32
- //--------------------------------------------------------------------------
33
- //
34
- // Methods
35
- //
36
- //--------------------------------------------------------------------------
37
- async signIn() {
38
- if (!this.credential) {
39
- try {
40
- this.credential = await this._checkCurrentStatus();
41
- }
42
- catch (error) {
43
- this.credential = await this._fetchCredential();
44
- }
45
- }
46
- return this.credential;
47
- }
48
- async signOut() {
49
- if (!this.credential) {
50
- try {
51
- this.identity.destroyCredentials();
52
- }
53
- catch (error) {
54
- this.credential = undefined;
55
- }
56
- }
57
- this.credential = undefined;
58
- return;
59
- }
60
- //--------------------------------------------------------------------------
61
- //
62
- // Lifecycle
63
- //
64
- //--------------------------------------------------------------------------
65
- async connectedCallback() {
66
- if (this.appId) {
67
- await this._registerOAuth();
68
- }
69
- this._proxyEvents();
70
- await this._addWatchers();
71
- this.identityReady.emit({ identity: this.identity, ready: true });
72
- }
73
- //--------------------------------------------------------------------------
74
- //
75
- // Private Methods
76
- //
77
- //--------------------------------------------------------------------------
78
- async _addWatchers() {
79
- const { watch } = await importCoreReactiveUtils();
80
- watch(() => this._info.expiration, (value) => (this.expiration = value), {
81
- initial: true
82
- });
83
- }
84
- _checkCurrentStatus() {
85
- return this.identity.checkSignInStatus(`${this._info.portalUrl}/sharing`);
86
- }
87
- async _createOAuthInfo() {
88
- const params = {};
89
- if (this.appId !== undefined) {
90
- params.appId = this.appId;
91
- }
92
- if (this.locale !== undefined) {
93
- params.locale = this.locale;
94
- }
95
- if (this.popupCallbackUrl !== undefined) {
96
- params.popupCallbackUrl = this.popupCallbackUrl;
97
- }
98
- if (this.preserveUrlHash !== undefined) {
99
- params.preserveUrlHash = this.preserveUrlHash;
100
- }
101
- if (this.usePopup !== undefined) {
102
- params.popup = this.usePopup;
103
- }
104
- if (this.portalUrl !== undefined) {
105
- params.portalUrl = this.portalUrl;
106
- }
107
- const info = await newIdentityOAuthInfo(params);
108
- this._info = info;
109
- return info;
110
- }
111
- async _fetchCredential() {
112
- const credential = await this.identity.getCredential(`${this._info?.portalUrl}/sharing`, {
113
- error: null,
114
- oAuthPopupConfirmation: false,
115
- token: null
116
- });
117
- return credential;
118
- }
119
- async _registerOAuth() {
120
- this.identity = await importIdentityIdentityManager();
121
- const info = await this._createOAuthInfo();
122
- this.identity.registerOAuthInfos([info]);
123
- }
124
- _proxyEvents() {
125
- this.identity.on("credential-create", (e) => this.credentialCreate.emit(e));
126
- this.identity.on("dialog-create", (e) => this.dialogCreate.emit(e));
127
- }
128
- get el() { return getElement(this); }
129
- static get watchers() { return {
130
- "appId": ["appIdWatcher"]
131
- }; }
132
- };
133
- ArcgisIdentity.style = arcgisIdentityCss;
134
-
135
- export { ArcgisIdentity as arcgis_identity };