@arcgis/common-components 4.29.0-beta.47 → 4.29.0-beta.49
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/dist/arcgis-common-components/arcgis-common-components.esm.js +1 -1
- package/dist/arcgis-common-components/p-6c7d2684.js +1 -0
- package/dist/arcgis-common-components/p-7318a1d1.entry.js +1 -0
- package/dist/arcgis-common-components/p-a91ab432.js +2 -0
- package/dist/arcgis-common-components/p-d3d1695f.entry.js +1 -0
- package/dist/cjs/arcgis-common-components.cjs.js +3 -3
- package/dist/cjs/arcgis-field-info.cjs.entry.js +903 -899
- package/dist/cjs/arcgis-field-pick-list.cjs.entry.js +216 -229
- package/dist/cjs/{index-2e4fbd31.js → index-5ec7f592.js} +5 -20
- package/dist/cjs/{index-ab5f2576.js → index-e0422bc8.js} +72 -77
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/components/arcgis-field-info.d.ts +2 -2
- package/dist/components/arcgis-field-pick-list.d.ts +2 -2
- package/dist/components/arcgis-field-pick-list.js +259 -272
- package/dist/components/field-info.js +961 -901
- package/dist/esm/arcgis-common-components.js +4 -4
- package/dist/esm/arcgis-field-info.entry.js +907 -903
- package/dist/esm/arcgis-field-pick-list.entry.js +216 -229
- package/dist/esm/{index-74897166.js → index-0c129ec4.js} +73 -78
- package/dist/esm/index-ba4fe890.js +59 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/field-info/field-info.d.ts +61 -61
- package/dist/types/components/field-info/t9n-types.d.ts +72 -72
- package/dist/types/components/field-info/utils/basic.d.ts +24 -24
- package/dist/types/components/field-info/utils/field.d.ts +1 -1
- package/dist/types/components/field-pick-list/field-pick-list.d.ts +115 -115
- package/dist/types/components/field-pick-list/t9n-types.d.ts +15 -15
- package/dist/types/components/field-pick-list/utils/types.d.ts +14 -14
- package/dist/types/components.d.ts +0 -86
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/package.json +7 -7
- package/dist/arcgis-common-components/p-0be8fd4c.entry.js +0 -1
- package/dist/arcgis-common-components/p-164eb24e.entry.js +0 -1
- package/dist/arcgis-common-components/p-5ecf6396.js +0 -1
- package/dist/arcgis-common-components/p-97c7ac8d.entry.js +0 -1
- package/dist/arcgis-common-components/p-b23318c8.js +0 -1
- package/dist/arcgis-common-components/p-d66b011b.entry.js +0 -1
- package/dist/arcgis-common-components/p-f27af39c.js +0 -2
- package/dist/cjs/arcgis-api-key.cjs.entry.js +0 -51
- package/dist/cjs/arcgis-identity.cjs.entry.js +0 -139
- package/dist/cjs/index-f8bf4df6.js +0 -7
- package/dist/components/arcgis-api-key.d.ts +0 -11
- package/dist/components/arcgis-api-key.js +0 -69
- package/dist/components/arcgis-identity.d.ts +0 -11
- package/dist/components/arcgis-identity.js +0 -167
- package/dist/components/index2.js +0 -75
- package/dist/esm/arcgis-api-key.entry.js +0 -47
- package/dist/esm/arcgis-identity.entry.js +0 -135
- package/dist/esm/index-3d9bb67e.js +0 -75
- package/dist/esm/index-e7244815.js +0 -3
- package/dist/types/components/api-key/api-key.d.ts +0 -9
- package/dist/types/components/identity/identity.d.ts +0 -31
- package/dist/types/components/types.d.ts +0 -10
|
@@ -2,256 +2,243 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$
|
|
7
|
-
const index$1 = require('./index-f8bf4df6.js');
|
|
5
|
+
const index = require('./index-e0422bc8.js');
|
|
6
|
+
const index$1 = require('./index-5ec7f592.js');
|
|
8
7
|
|
|
9
8
|
const fieldPickListScss = ".popover{z-index:100}.panel{min-height:300px}.content{max-height:60vh}.selection-button-div{padding:4px 10px}";
|
|
10
9
|
|
|
11
10
|
var FieldInfoPrefix;
|
|
12
11
|
(function (FieldInfoPrefix) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
FieldInfoPrefix["expression"] = "expression/";
|
|
13
|
+
FieldInfoPrefix["relationship"] = "relationships/";
|
|
14
|
+
FieldInfoPrefix["raster"] = "Raster.";
|
|
16
15
|
})(FieldInfoPrefix || (FieldInfoPrefix = {}));
|
|
17
16
|
var LastSortyBy;
|
|
18
17
|
(function (LastSortyBy) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
LastSortyBy["default"] = "default";
|
|
19
|
+
LastSortyBy["display"] = "display";
|
|
20
|
+
LastSortyBy["type"] = "type";
|
|
21
|
+
LastSortyBy["field"] = "field";
|
|
23
22
|
})(LastSortyBy || (LastSortyBy = {}));
|
|
24
23
|
const ArcgisFieldPickList = class {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
constructor(hostRef) {
|
|
25
|
+
index.registerInstance(this, hostRef);
|
|
26
|
+
this.arcgisFieldPickListDismissed = index.createEvent(this, "arcgisFieldPickListDismissed", 7);
|
|
27
|
+
this.arcgisFieldPickListChange = index.createEvent(this, "arcgisFieldPickListChange", 7);
|
|
28
|
+
this.arcgisFieldPickListSortByChange = index.createEvent(this, "arcgisFieldPickListSortByChange", 7);
|
|
29
|
+
this.calciteValueList = (field) => (index.h("calcite-pick-list-item", { key: field.name, label: field.alias || field.name, description: (() => {
|
|
30
|
+
if (this.showFieldName) {
|
|
31
|
+
return `{${field.name}}`;
|
|
32
|
+
}
|
|
33
|
+
if (this.showDescription && field.description) {
|
|
34
|
+
return field.description;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
})(), value: field.name, selected: (!this.multiple && field.name === this.selectedFields[0]) ||
|
|
38
|
+
(this.multiple && this.selectedFields.indexOf(field.name) > -1), metadata: {
|
|
39
|
+
label: field.alias,
|
|
40
|
+
fieldName: field.name
|
|
41
|
+
} }, this.showFieldInfoCheck(field) && (index.h("calcite-action", { slot: "actions-end", text: this._t9nStrings.info, title: this._t9nStrings.info, scale: "s", icon: "information", onClick: (event) => {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
const action = event.target;
|
|
44
|
+
const fieldInfoFlowItem = document.createElement("calcite-flow-item");
|
|
45
|
+
fieldInfoFlowItem.heading = field.alias ?? field.name;
|
|
46
|
+
fieldInfoFlowItem.description = field.name;
|
|
47
|
+
fieldInfoFlowItem.className = "panel";
|
|
48
|
+
const fieldInfo = document.createElement("arcgis-field-info");
|
|
49
|
+
fieldInfo.lang = this._lang;
|
|
50
|
+
fieldInfo.fieldName = field.name;
|
|
51
|
+
fieldInfo.layer = this.layer;
|
|
52
|
+
fieldInfo.view = this.mapView;
|
|
53
|
+
fieldInfo.classList.add("content");
|
|
54
|
+
fieldInfoFlowItem.appendChild(fieldInfo);
|
|
55
|
+
fieldInfoFlowItem.addEventListener("calciteFlowItemBack", () => setTimeout(() => requestAnimationFrame(() => action.setFocus()), 200));
|
|
56
|
+
this.flowElement.appendChild(fieldInfoFlowItem);
|
|
57
|
+
setTimeout(() => requestAnimationFrame(() => fieldInfoFlowItem.setFocus()), 200);
|
|
58
|
+
} }))));
|
|
59
|
+
this.selectedFields = [];
|
|
60
|
+
this.fields = undefined;
|
|
61
|
+
this.popoverProps = undefined;
|
|
62
|
+
this.layer = undefined;
|
|
63
|
+
this.mapView = undefined;
|
|
64
|
+
this.showFieldInfo = false;
|
|
65
|
+
this.showFieldName = false;
|
|
66
|
+
this.showDescription = false;
|
|
67
|
+
this.showSelectionAll = false;
|
|
68
|
+
this.showCancel = true;
|
|
69
|
+
this.showSort = true;
|
|
70
|
+
this.showFilterLength = 10;
|
|
71
|
+
this.multiple = false;
|
|
72
|
+
this.heading = undefined;
|
|
73
|
+
this.okBtnText = undefined;
|
|
74
|
+
this.filterPlaceholderText = undefined;
|
|
75
|
+
this.sortBy = undefined;
|
|
76
|
+
this.lastSortyBy = LastSortyBy.default;
|
|
77
|
+
this.filterFields = null;
|
|
78
|
+
this._lang = "";
|
|
79
|
+
this._t9nLocale = "";
|
|
80
|
+
this._t9nStrings = undefined;
|
|
81
|
+
}
|
|
82
|
+
// --------------------------------------------------------------------------
|
|
83
|
+
//
|
|
84
|
+
// Lifecycle
|
|
85
|
+
//
|
|
86
|
+
// --------------------------------------------------------------------------
|
|
87
|
+
async componentWillLoad() {
|
|
88
|
+
await index$1.F(this, index.getAssetPath("./assets"));
|
|
89
|
+
// in case more than 1 selected field and multiple is set to false
|
|
90
|
+
if (!this.multiple && this.selectedFields.length > 1) {
|
|
91
|
+
this.selectedFields = [this.selectedFields[0]];
|
|
36
92
|
}
|
|
37
|
-
|
|
38
|
-
})(), value: field.name, selected: (!this.multiple && field.name === this.selectedFields[0]) ||
|
|
39
|
-
(this.multiple && this.selectedFields.indexOf(field.name) > -1), metadata: {
|
|
40
|
-
label: field.alias,
|
|
41
|
-
fieldName: field.name
|
|
42
|
-
} }, this.showFieldInfoCheck(field) && (index.h("calcite-action", { slot: "actions-end", text: this._t9nStrings.info, title: this._t9nStrings.info, scale: "s", icon: "information", onClick: (event) => {
|
|
43
|
-
event.stopPropagation();
|
|
44
|
-
const action = event.target;
|
|
45
|
-
const fieldInfoFlowItem = document.createElement("calcite-flow-item");
|
|
46
|
-
fieldInfoFlowItem.heading = field.alias ?? field.name;
|
|
47
|
-
fieldInfoFlowItem.description = field.name;
|
|
48
|
-
fieldInfoFlowItem.className = "panel";
|
|
49
|
-
const fieldInfo = document.createElement("arcgis-field-info");
|
|
50
|
-
fieldInfo.lang = this._lang;
|
|
51
|
-
fieldInfo.fieldName = field.name;
|
|
52
|
-
fieldInfo.layer = this.layer;
|
|
53
|
-
fieldInfo.view = this.mapView;
|
|
54
|
-
fieldInfo.classList.add("content");
|
|
55
|
-
fieldInfoFlowItem.appendChild(fieldInfo);
|
|
56
|
-
fieldInfoFlowItem.addEventListener("calciteFlowItemBack", () => setTimeout(() => requestAnimationFrame(() => action.setFocus()), 200));
|
|
57
|
-
this.flowElement.appendChild(fieldInfoFlowItem);
|
|
58
|
-
setTimeout(() => requestAnimationFrame(() => fieldInfoFlowItem.setFocus()), 200);
|
|
59
|
-
} }))));
|
|
60
|
-
this.selectedFields = [];
|
|
61
|
-
this.fields = undefined;
|
|
62
|
-
this.popoverProps = undefined;
|
|
63
|
-
this.layer = undefined;
|
|
64
|
-
this.mapView = undefined;
|
|
65
|
-
this.showFieldInfo = false;
|
|
66
|
-
this.showFieldName = false;
|
|
67
|
-
this.showDescription = false;
|
|
68
|
-
this.showSelectionAll = false;
|
|
69
|
-
this.showCancel = true;
|
|
70
|
-
this.showSort = true;
|
|
71
|
-
this.showFilterLength = 10;
|
|
72
|
-
this.multiple = false;
|
|
73
|
-
this.heading = undefined;
|
|
74
|
-
this.okBtnText = undefined;
|
|
75
|
-
this.filterPlaceholderText = undefined;
|
|
76
|
-
this.sortBy = undefined;
|
|
77
|
-
this.lastSortyBy = LastSortyBy.default;
|
|
78
|
-
this.filterFields = null;
|
|
79
|
-
this._lang = "";
|
|
80
|
-
this._t9nLocale = "";
|
|
81
|
-
this._t9nStrings = undefined;
|
|
82
|
-
}
|
|
83
|
-
// --------------------------------------------------------------------------
|
|
84
|
-
//
|
|
85
|
-
// Lifecycle
|
|
86
|
-
//
|
|
87
|
-
// --------------------------------------------------------------------------
|
|
88
|
-
async componentWillLoad() {
|
|
89
|
-
await index$1.F(this, index.getAssetPath("./assets"));
|
|
90
|
-
// in case more than 1 selected field and multiple is set to false
|
|
91
|
-
if (!this.multiple && this.selectedFields.length > 1) {
|
|
92
|
-
this.selectedFields = [this.selectedFields[0]];
|
|
93
|
+
this.lastSortyBy = this.sortBy || this.lastSortyBy;
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// need timeout because of re-render
|
|
102
|
-
setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 200);
|
|
103
|
-
}
|
|
104
|
-
disconnectedCallback() {
|
|
105
|
-
index$1.U(this);
|
|
106
|
-
this.observer?.disconnect();
|
|
107
|
-
}
|
|
108
|
-
// --------------------------------------------------------------------------
|
|
109
|
-
//
|
|
110
|
-
// Public Methods
|
|
111
|
-
//
|
|
112
|
-
// --------------------------------------------------------------------------
|
|
113
|
-
async setFocus() {
|
|
114
|
-
setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 1);
|
|
115
|
-
}
|
|
116
|
-
async reposition() {
|
|
117
|
-
this.popoverNode?.reposition();
|
|
118
|
-
}
|
|
119
|
-
// --------------------------------------------------------------------------
|
|
120
|
-
//
|
|
121
|
-
// Private Methods
|
|
122
|
-
//
|
|
123
|
-
// --------------------------------------------------------------------------
|
|
124
|
-
getSortedList() {
|
|
125
|
-
const tempSorted = [...this.fields];
|
|
126
|
-
if (this.lastSortyBy === LastSortyBy.display) {
|
|
127
|
-
tempSorted.sort((a, b) => a.alias.localeCompare(b.alias));
|
|
95
|
+
async componentDidLoad() {
|
|
96
|
+
const intl = await index$1.importIntl();
|
|
97
|
+
intl.setLocale(this._lang);
|
|
98
|
+
this.setUpObserver();
|
|
99
|
+
this.popoverNode.open = true;
|
|
100
|
+
// need timeout because of re-render
|
|
101
|
+
setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 200);
|
|
128
102
|
}
|
|
129
|
-
|
|
130
|
-
|
|
103
|
+
disconnectedCallback() {
|
|
104
|
+
index$1.U(this);
|
|
105
|
+
this.observer?.disconnect();
|
|
131
106
|
}
|
|
132
|
-
|
|
133
|
-
|
|
107
|
+
// --------------------------------------------------------------------------
|
|
108
|
+
//
|
|
109
|
+
// Public Methods
|
|
110
|
+
//
|
|
111
|
+
// --------------------------------------------------------------------------
|
|
112
|
+
async setFocus() {
|
|
113
|
+
setTimeout(() => requestAnimationFrame(() => this.panelElement.setFocus()), 1);
|
|
134
114
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
showFieldInfoCheck(field) {
|
|
138
|
-
if (this.showFieldInfo) {
|
|
139
|
-
// dont want info for arcade and relation fields
|
|
140
|
-
if (field.name.includes(FieldInfoPrefix.expression) || field.name.includes(FieldInfoPrefix.relationship)) {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
115
|
+
async reposition() {
|
|
116
|
+
this.popoverNode?.reposition();
|
|
146
117
|
}
|
|
147
|
-
|
|
148
|
-
|
|
118
|
+
// --------------------------------------------------------------------------
|
|
119
|
+
//
|
|
120
|
+
// Private Methods
|
|
121
|
+
//
|
|
122
|
+
// --------------------------------------------------------------------------
|
|
123
|
+
getSortedList() {
|
|
124
|
+
const tempSorted = [...this.fields];
|
|
125
|
+
if (this.lastSortyBy === LastSortyBy.display) {
|
|
126
|
+
tempSorted.sort((a, b) => a.alias.localeCompare(b.alias));
|
|
127
|
+
}
|
|
128
|
+
else if (this.lastSortyBy === LastSortyBy.field) {
|
|
129
|
+
tempSorted.sort((a, b) => a.name.localeCompare(b.name));
|
|
130
|
+
}
|
|
131
|
+
else if (this.lastSortyBy === LastSortyBy.type) {
|
|
132
|
+
tempSorted.sort((a, b) => a.type.localeCompare(b.type));
|
|
133
|
+
}
|
|
134
|
+
return tempSorted;
|
|
149
135
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return curr === filter;
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
// --------------------------------------------------------------------------
|
|
164
|
-
//
|
|
165
|
-
// Rendor Methods
|
|
166
|
-
//
|
|
167
|
-
// --------------------------------------------------------------------------
|
|
168
|
-
render() {
|
|
169
|
-
const addBtn = (index.h("calcite-button", { slot: "footer", appearance: this.showCancel ? "solid" : "outline-fill", width: this.showCancel ? "half" : "full", scale: "m", onClick: () => {
|
|
170
|
-
this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
171
|
-
} }, this.okBtnText || (this.multiple ? this._t9nStrings.done : this._t9nStrings.ok)));
|
|
172
|
-
const cancelBtn = (index.h("calcite-button", { slot: "footer", appearance: "outline-fill", width: this.multiple ? "half" : "full", scale: "m", onClick: () => this.arcgisFieldPickListDismissed.emit() }, this._t9nStrings.cancel));
|
|
173
|
-
const hasType = this.fields.every((field) => !!field.type);
|
|
174
|
-
const sort = (index.h("calcite-dropdown", { slot: "menu-actions", placement: "bottom-end", overlayPositioning: "fixed", ref: (node) => (this.dropdownNode = node), onCalciteDropdownOpen: () => {
|
|
175
|
-
this.observer?.disconnect();
|
|
176
|
-
this.observer?.observe(this.popoverNode, { attributes: true });
|
|
177
|
-
}, onCalciteDropdownClose: () => this.observer?.disconnect() }, index.h("calcite-action", { slot: "trigger", text: this._t9nStrings.sort, title: this._t9nStrings.sort }, index.h("calcite-icon", { scale: "s", icon: "sortDescending" })), index.h("calcite-dropdown-group", null, index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.default, onClick: () => {
|
|
178
|
-
this.lastSortyBy = LastSortyBy.default;
|
|
179
|
-
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
180
|
-
} }, this._t9nStrings.default), index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.display, onClick: () => {
|
|
181
|
-
this.lastSortyBy = LastSortyBy.display;
|
|
182
|
-
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
183
|
-
} }, this._t9nStrings.displayName), hasType && (index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.type, onClick: () => {
|
|
184
|
-
this.lastSortyBy = LastSortyBy.type;
|
|
185
|
-
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
186
|
-
} }, this._t9nStrings.type)), index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.field, onClick: () => {
|
|
187
|
-
this.lastSortyBy = LastSortyBy.field;
|
|
188
|
-
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
189
|
-
} }, this._t9nStrings.fieldName))));
|
|
190
|
-
const selectionBtn = (index.h("div", { class: "selection-button-div" }, index.h("calcite-button", { appearance: "transparent", scale: "s", width: "full", onClick: () => {
|
|
191
|
-
if (this.selectDeselect()) {
|
|
192
|
-
//deselect all
|
|
193
|
-
this.selectedFields = this.filterFields?.length
|
|
194
|
-
? this.selectedFields.filter((item) => !this.filterFields?.includes(item))
|
|
195
|
-
: [];
|
|
136
|
+
showFieldInfoCheck(field) {
|
|
137
|
+
if (this.showFieldInfo) {
|
|
138
|
+
// dont want info for arcade and relation fields
|
|
139
|
+
if (field.name.includes(FieldInfoPrefix.expression) || field.name.includes(FieldInfoPrefix.relationship)) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
196
145
|
}
|
|
197
146
|
else {
|
|
198
|
-
|
|
199
|
-
this.selectedFields = this.filterFields?.length
|
|
200
|
-
? [...new Set([...this.selectedFields, ...this.filterFields])]
|
|
201
|
-
: this.fields.map((field) => {
|
|
202
|
-
return field.name;
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
} }, this.selectDeselect() ? this._t9nStrings.deselectAll : this._t9nStrings.selectAll)));
|
|
206
|
-
return (index.h(index.Host, { class: "js-app-flyout" }, index.h("calcite-popover", { dir: index$1.C(this._hostElement), class: "popover", placement: this.popoverProps.placement || "leading-start", open: false, pointerDisabled: true, referenceElement: this.popoverProps.refElement, offsetDistance: this.popoverProps.offsetDistance || -Math.round(this.popoverProps.refElement.getBoundingClientRect().width), offsetSkidding: this.popoverProps.offsetSkidding || 0, overlayPositioning: this.popoverProps.overlayPositioning, triggerDisabled: this.popoverProps.triggerDisabled, autoClose: this.popoverProps.autoClose, label: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), onCalcitePopoverClose: () => this.arcgisFieldPickListDismissed.emit(), ref: (node) => (this.popoverNode = node) }, index.h("calcite-flow", { ref: (node) => {
|
|
207
|
-
this.flowElement = node;
|
|
208
|
-
}, style: {
|
|
209
|
-
width: `${this.popoverProps.popoverWidth || this.popoverProps.refElement.getBoundingClientRect().width}px`
|
|
210
|
-
} }, index.h("calcite-flow-item", { ref: (el) => (this.panelElement = el), class: "panel", heading: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), closable: true, onCalciteFlowItemClose: () => this.arcgisFieldPickListDismissed.emit() }, this.multiple && addBtn, this.showCancel && cancelBtn, index.h("calcite-pick-list", { multiple: this.multiple, ref: (node) => {
|
|
211
|
-
this.pickListNode = node;
|
|
212
|
-
}, class: "content", filterEnabled: this.fields.length >= this.showFilterLength ? true : false, filterPlaceholder: this.filterPlaceholderText ?? this._t9nStrings.filter, onCalciteListChange: async () => {
|
|
213
|
-
// keep original order. Add addional values at the end
|
|
214
|
-
const tempSelectedFields = await this.pickListNode.getSelectedItems();
|
|
215
|
-
this.selectedFields = [
|
|
216
|
-
...new Set([
|
|
217
|
-
...this.selectedFields.filter((item) => {
|
|
218
|
-
return tempSelectedFields.has(item);
|
|
219
|
-
}),
|
|
220
|
-
...tempSelectedFields.keys()
|
|
221
|
-
])
|
|
222
|
-
];
|
|
223
|
-
this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
|
|
224
|
-
if (!this.multiple) {
|
|
225
|
-
this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
147
|
+
return false;
|
|
226
148
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
this.filterFields
|
|
231
|
-
|
|
149
|
+
}
|
|
150
|
+
// return true for deselect all, false for select all
|
|
151
|
+
selectDeselect() {
|
|
152
|
+
return this.filterFields?.length ? this.filterContainsAll() : this.selectedFields.length === this.fields.length;
|
|
153
|
+
}
|
|
154
|
+
// check if filter has all current field info
|
|
155
|
+
filterContainsAll() {
|
|
156
|
+
return !!this.filterFields?.every((filter) => this.selectedFields.some((curr) => curr === filter));
|
|
157
|
+
}
|
|
158
|
+
// --------------------------------------------------------------------------
|
|
159
|
+
//
|
|
160
|
+
// Rendor Methods
|
|
161
|
+
//
|
|
162
|
+
// --------------------------------------------------------------------------
|
|
163
|
+
render() {
|
|
164
|
+
const addBtn = (index.h("calcite-button", { slot: "footer", appearance: this.showCancel ? "solid" : "outline-fill", width: this.showCancel ? "half" : "full", scale: "m", onClick: () => {
|
|
165
|
+
this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
166
|
+
} }, this.okBtnText || (this.multiple ? this._t9nStrings.done : this._t9nStrings.ok)));
|
|
167
|
+
const cancelBtn = (index.h("calcite-button", { slot: "footer", appearance: "outline-fill", width: this.multiple ? "half" : "full", scale: "m", onClick: () => this.arcgisFieldPickListDismissed.emit() }, this._t9nStrings.cancel));
|
|
168
|
+
const hasType = this.fields.every((field) => !!field.type);
|
|
169
|
+
const sort = (index.h("calcite-dropdown", { slot: "menu-actions", placement: "bottom-end", overlayPositioning: "fixed", ref: (node) => (this.dropdownNode = node), onCalciteDropdownOpen: () => {
|
|
170
|
+
this.observer?.disconnect();
|
|
171
|
+
this.observer?.observe(this.popoverNode, { attributes: true });
|
|
172
|
+
}, onCalciteDropdownClose: () => this.observer?.disconnect() }, index.h("calcite-action", { slot: "trigger", text: this._t9nStrings.sort, title: this._t9nStrings.sort }, index.h("calcite-icon", { scale: "s", icon: "sortDescending" })), index.h("calcite-dropdown-group", null, index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.default, onClick: () => {
|
|
173
|
+
this.lastSortyBy = LastSortyBy.default;
|
|
174
|
+
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
175
|
+
} }, this._t9nStrings.default), index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.display, onClick: () => {
|
|
176
|
+
this.lastSortyBy = LastSortyBy.display;
|
|
177
|
+
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
178
|
+
} }, this._t9nStrings.displayName), hasType && (index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.type, onClick: () => {
|
|
179
|
+
this.lastSortyBy = LastSortyBy.type;
|
|
180
|
+
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
181
|
+
} }, this._t9nStrings.type)), index.h("calcite-dropdown-item", { selected: this.lastSortyBy === LastSortyBy.field, onClick: () => {
|
|
182
|
+
this.lastSortyBy = LastSortyBy.field;
|
|
183
|
+
this.arcgisFieldPickListSortByChange.emit(this.lastSortyBy);
|
|
184
|
+
} }, this._t9nStrings.fieldName))));
|
|
185
|
+
const selectionBtn = (index.h("div", { class: "selection-button-div" }, index.h("calcite-button", { appearance: "transparent", scale: "s", width: "full", onClick: () => {
|
|
186
|
+
if (this.selectDeselect()) {
|
|
187
|
+
//deselect all
|
|
188
|
+
this.selectedFields = this.filterFields?.length
|
|
189
|
+
? this.selectedFields.filter((item) => !this.filterFields?.includes(item))
|
|
190
|
+
: [];
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
//select all
|
|
194
|
+
this.selectedFields = this.filterFields?.length
|
|
195
|
+
? [...new Set([...this.selectedFields, ...this.filterFields])]
|
|
196
|
+
: this.fields.map((field) => field.name);
|
|
197
|
+
}
|
|
198
|
+
} }, this.selectDeselect() ? this._t9nStrings.deselectAll : this._t9nStrings.selectAll)));
|
|
199
|
+
return (index.h(index.Host, { class: "js-app-flyout" }, index.h("calcite-popover", { dir: index$1.C(this._hostElement), class: "popover", placement: this.popoverProps.placement || "leading-start", open: false, pointerDisabled: true, referenceElement: this.popoverProps.refElement, offsetDistance: this.popoverProps.offsetDistance || -Math.round(this.popoverProps.refElement.getBoundingClientRect().width), offsetSkidding: this.popoverProps.offsetSkidding || 0, overlayPositioning: this.popoverProps.overlayPositioning, triggerDisabled: this.popoverProps.triggerDisabled, autoClose: this.popoverProps.autoClose, label: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), onCalcitePopoverClose: () => this.arcgisFieldPickListDismissed.emit(), ref: (node) => (this.popoverNode = node) }, index.h("calcite-flow", { ref: (node) => {
|
|
200
|
+
this.flowElement = node;
|
|
201
|
+
}, style: {
|
|
202
|
+
width: `${this.popoverProps.popoverWidth || this.popoverProps.refElement.getBoundingClientRect().width}px`
|
|
203
|
+
} }, index.h("calcite-flow-item", { ref: (el) => (this.panelElement = el), class: "panel", heading: this.heading || (this.multiple ? this._t9nStrings.headerSelect : this._t9nStrings.header), closable: true, onCalciteFlowItemClose: () => this.arcgisFieldPickListDismissed.emit() }, this.multiple && addBtn, this.showCancel && cancelBtn, index.h("calcite-pick-list", { multiple: this.multiple, ref: (node) => {
|
|
204
|
+
this.pickListNode = node;
|
|
205
|
+
}, class: "content", filterEnabled: this.fields.length >= this.showFilterLength, filterPlaceholder: this.filterPlaceholderText ?? this._t9nStrings.filter, onCalciteListChange: async () => {
|
|
206
|
+
// keep original order. Add addional values at the end
|
|
207
|
+
const tempSelectedFields = await this.pickListNode.getSelectedItems();
|
|
208
|
+
this.selectedFields = [
|
|
209
|
+
...new Set([
|
|
210
|
+
...this.selectedFields.filter((item) => tempSelectedFields.has(item)),
|
|
211
|
+
...tempSelectedFields.keys()
|
|
212
|
+
])
|
|
213
|
+
];
|
|
214
|
+
this.arcgisFieldPickListChange.emit({ selectedFields: this.selectedFields });
|
|
215
|
+
if (!this.multiple) {
|
|
216
|
+
this.arcgisFieldPickListDismissed.emit({ selectedFields: this.selectedFields });
|
|
217
|
+
}
|
|
218
|
+
}, onCalciteListFilter: (event) => {
|
|
219
|
+
event.stopPropagation();
|
|
220
|
+
const node = event.target;
|
|
221
|
+
this.filterFields = node.filteredItems?.map((item) => item.value);
|
|
222
|
+
} }, this.fields.length >= this.showFilterLength && this.showSort && sort, this.multiple && this.showSelectionAll && selectionBtn, [...this.getSortedList()].map((field) => this.calciteValueList(field))))))));
|
|
223
|
+
}
|
|
224
|
+
// --------------------------------------------------------------------------
|
|
225
|
+
//
|
|
226
|
+
// Private Methods
|
|
227
|
+
//
|
|
228
|
+
// --------------------------------------------------------------------------
|
|
229
|
+
setUpObserver() {
|
|
230
|
+
this.observer = new MutationObserver((mutationList /* , observer */) => {
|
|
231
|
+
for (const mutation of mutationList) {
|
|
232
|
+
if (mutation.attributeName === "style") {
|
|
233
|
+
if (this.popoverNode.style.visibility === "hidden") {
|
|
234
|
+
this.dropdownNode.open = false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
232
238
|
});
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
// --------------------------------------------------------------------------
|
|
238
|
-
//
|
|
239
|
-
// Private Methods
|
|
240
|
-
//
|
|
241
|
-
// --------------------------------------------------------------------------
|
|
242
|
-
setUpObserver() {
|
|
243
|
-
this.observer = new MutationObserver((mutationList /* , observer */) => {
|
|
244
|
-
for (const mutation of mutationList) {
|
|
245
|
-
if (mutation.attributeName === "style") {
|
|
246
|
-
if (this.popoverNode.style.visibility === "hidden") {
|
|
247
|
-
this.dropdownNode.open = false;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
static get assetsDirs() { return ["assets"]; }
|
|
254
|
-
get _hostElement() { return index.getElement(this); }
|
|
239
|
+
}
|
|
240
|
+
static get assetsDirs() { return ["assets"]; }
|
|
241
|
+
get _hostElement() { return index.getElement(this); }
|
|
255
242
|
};
|
|
256
243
|
ArcgisFieldPickList.style = fieldPickListScss;
|
|
257
244
|
|
|
@@ -26,24 +26,6 @@ function requireModule(modulePath) {
|
|
|
26
26
|
resolve(moduleDefault);
|
|
27
27
|
}));
|
|
28
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
29
|
async function importRestSupportQuery() {
|
|
48
30
|
if (amd) {
|
|
49
31
|
return requireModule("esri/rest/support/Query");
|
|
@@ -94,12 +76,15 @@ async function importSmartMappingStatisticsUniqueValues() {
|
|
|
94
76
|
return module.default;
|
|
95
77
|
}
|
|
96
78
|
|
|
79
|
+
function S(e,t){let n=e;for(;n;){if(n===t)return !0;if(!n.parentNode)return !1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode;}return !1}function T(e,t,n=()=>{}){if(!t||t.length<=0)return;let r=new MutationObserver(o=>{for(let i of o)S(e,i.target)&&n();});return r.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0}),r}function E(e,t){let n=e;for(;n;){let r=n.closest(t);if(r)return r;let o=n.getRootNode();if(o===document)return null;n=o.host;}return null}function C(e){return f(e,"dir","ltr")}function f(e,t,n){return E(e,`[${t}]`)?.getAttribute(t)??n}var x=new Set(["ar","bg","bs","ca","cs","da","de","el","en","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nl","nb","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"]),a=new Map;async function N(e,t,n=""){let r=`${t}/${n}${e}.json`;if(a.has(r))return a.get(r);try{let o=await fetch(r);if(o.ok){let s=await o.json();return a.set(r,s),s}if(e==="en"){a.set(r,void 0);return}let i=await N("en",t,n);return a.set(r,i),i}catch{a.set(r,void 0);return}}function R(e){let t=f(e,"lang",navigator?.language||"en");if(x.has(t))return {lang:t,t9nLocale:t};let n=t.slice(0,2);return {lang:t,t9nLocale:x.has(n)?n:"en"}}var m=new WeakMap,h=new WeakMap,_=new WeakMap;async function F(e,t,n){h.set(e,t),m.set(e,T(e._hostElement,["lang"],()=>{b(e,n);})),await b(e,n);}function U(e){m.get(e)?.disconnect(),m.delete(e),h.delete(e);}async function b(e,t){let{lang:n,t9nLocale:r}=R(e._hostElement);if(n===e._lang&&r===e._t9nLocale||(n!==e._lang&&(e._lang=n),r===e._t9nLocale))return;let o=_.get(e);if(!o){let i=h.get(e)??"",s=e._hostElement.tagName.toLowerCase().replace("arcgis-",""),u=`${i}/${s}/t9n`,l=`${s}.t9n.`;o=await N(r,u,l);}e._t9nLocale=r,e._t9nStrings=o,await t?.call(e);}
|
|
80
|
+
|
|
81
|
+
exports.C = C;
|
|
82
|
+
exports.F = F;
|
|
83
|
+
exports.U = U;
|
|
97
84
|
exports.importConfig = importConfig;
|
|
98
85
|
exports.importCoreLang = importCoreLang;
|
|
99
86
|
exports.importCoreReactiveUtils = importCoreReactiveUtils;
|
|
100
|
-
exports.importIdentityIdentityManager = importIdentityIdentityManager;
|
|
101
87
|
exports.importIntl = importIntl;
|
|
102
88
|
exports.importRestSupportQuery = importRestSupportQuery;
|
|
103
89
|
exports.importSmartMappingStatisticsSummaryStatistics = importSmartMappingStatisticsSummaryStatistics;
|
|
104
90
|
exports.importSmartMappingStatisticsUniqueValues = importSmartMappingStatisticsUniqueValues;
|
|
105
|
-
exports.newIdentityOAuthInfo = newIdentityOAuthInfo;
|