@esri/solutions-components 0.4.0 → 0.4.2

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 (76) hide show
  1. package/dist/assets/t9n/map-select-tools/resources.json +1 -1
  2. package/dist/assets/t9n/map-select-tools/resources_en.json +1 -1
  3. package/dist/assets/t9n/public-notification/resources.json +5 -5
  4. package/dist/assets/t9n/public-notification/resources_en.json +5 -5
  5. package/dist/assets/t9n/refine-selection/resources.json +3 -3
  6. package/dist/assets/t9n/refine-selection/resources_en.json +3 -3
  7. package/dist/cjs/calcite-input-message_5.cjs.entry.js +1344 -18
  8. package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-da276a1c.js → downloadUtils-99981c6b.js} +278 -1383
  9. package/dist/cjs/{index.es-176629d8.js → index.es-53f3bc97.js} +3 -13
  10. package/dist/cjs/layer-table.cjs.entry.js +5 -15
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/public-notification.cjs.entry.js +25 -10
  13. package/dist/cjs/solutions-components.cjs.js +1 -1
  14. package/dist/collection/components/layer-table/layer-table.js +4 -16
  15. package/dist/collection/components/map-search/map-search.js +1 -1
  16. package/dist/collection/components/map-select-tools/map-select-tools.js +43 -39
  17. package/dist/collection/components/pdf-download/pdf-download.js +33 -80
  18. package/dist/collection/components/public-notification/public-notification.js +26 -11
  19. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  20. package/dist/collection/utils/csvUtils.js +4 -0
  21. package/dist/collection/utils/csvUtils.ts +7 -0
  22. package/dist/collection/utils/downloadUtils.js +254 -0
  23. package/dist/collection/utils/downloadUtils.ts +344 -0
  24. package/dist/collection/utils/interfaces.ts +3 -2
  25. package/dist/collection/utils/pdfUtils.js +7 -0
  26. package/dist/collection/utils/pdfUtils.ts +13 -2
  27. package/dist/components/downloadUtils.js +2352 -0
  28. package/dist/components/index.es.js +1 -1
  29. package/dist/components/layer-table.js +5 -16
  30. package/dist/components/map-layer-picker2.js +1 -1
  31. package/dist/components/map-search.js +1 -1
  32. package/dist/components/map-select-tools2.js +45 -41
  33. package/dist/components/pdf-download2.js +14 -2126
  34. package/dist/components/public-notification.js +26 -11
  35. package/dist/components/queryUtils.js +1 -1
  36. package/dist/components/refine-selection-tools2.js +1 -1
  37. package/dist/components/refine-selection2.js +1 -1
  38. package/dist/esm/buffer-tools_6.entry.js +1 -1
  39. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  40. package/dist/esm/calcite-input-message_5.entry.js +1343 -13
  41. package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-c6f63458.js → downloadUtils-4bb47330.js} +279 -1381
  42. package/dist/esm/{index.es-54a6f3a3.js → index.es-4424d2f7.js} +2 -12
  43. package/dist/esm/layer-table.entry.js +6 -16
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/{mapViewUtils-63e118f8.js → mapViewUtils-02696ab6.js} +1 -1
  46. package/dist/esm/public-notification.entry.js +26 -11
  47. package/dist/esm/solutions-components.js +1 -1
  48. package/dist/solutions-components/p-0aed9b0d.js +437 -0
  49. package/dist/solutions-components/p-0d3b0fa0.entry.js +17 -0
  50. package/dist/solutions-components/{p-cc2e20c8.js → p-1bfd07e3.js} +1 -1
  51. package/dist/solutions-components/{p-117174e8.entry.js → p-335fce8c.entry.js} +1 -1
  52. package/dist/solutions-components/{p-1e459361.js → p-50117f71.js} +3 -3
  53. package/dist/solutions-components/p-5e4dfbe4.entry.js +6 -0
  54. package/dist/solutions-components/{p-8a0c0935.entry.js → p-a3b60bc9.entry.js} +1 -1
  55. package/dist/solutions-components/p-ec7f7804.entry.js +6 -0
  56. package/dist/solutions-components/solutions-components.esm.js +1 -1
  57. package/dist/solutions-components/utils/csvUtils.ts +7 -0
  58. package/dist/solutions-components/utils/downloadUtils.ts +344 -0
  59. package/dist/solutions-components/utils/interfaces.ts +3 -2
  60. package/dist/solutions-components/utils/pdfUtils.ts +13 -2
  61. package/dist/types/components/map-select-tools/map-select-tools.d.ts +12 -6
  62. package/dist/types/components/pdf-download/pdf-download.d.ts +4 -20
  63. package/dist/types/components/public-notification/public-notification.d.ts +9 -1
  64. package/dist/types/components.d.ts +4 -2
  65. package/dist/types/utils/downloadUtils.d.ts +42 -0
  66. package/dist/types/utils/interfaces.d.ts +2 -3
  67. package/dist/types/utils/pdfUtils.d.ts +3 -1
  68. package/package.json +1 -1
  69. package/dist/cjs/csvUtils-3a56c6d8.js +0 -54
  70. package/dist/components/csvUtils.js +0 -52
  71. package/dist/esm/csvUtils-23b5418f.js +0 -52
  72. package/dist/solutions-components/p-3069e3b7.js +0 -21
  73. package/dist/solutions-components/p-6d28f991.entry.js +0 -6
  74. package/dist/solutions-components/p-80f5e33c.js +0 -416
  75. package/dist/solutions-components/p-8927862a.entry.js +0 -6
  76. package/dist/solutions-components/p-e69c58e5.entry.js +0 -6
@@ -1,54 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- 'use strict';
7
-
8
- /** @license
9
- * Copyright 2022 Esri
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
- /**
24
- * Export a csv of the attributes from the features that match the provided ids
25
- *
26
- * @param labels Labels to write
27
- */
28
- function exportCSV(labels) {
29
- // Format values to string so it doesn't get tripped up when a value has a comma
30
- // another option could be to export with a different delimiter
31
- const outputLines = labels.map(label => Object.values(label).map(v => `"${v}"`).join(",") + "\r\n");
32
- _downloadCSVFile(outputLines, `notify-${Date.now().toString()}`);
33
- }
34
- /**
35
- * Download the CSV file
36
- *
37
- * @param outputLines Lines of output to write to file
38
- * @param fileTitle Title (without file extension) to use for file; defaults to "export"
39
- *
40
- * @see {@link https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2}
41
- */
42
- function _downloadCSVFile(outputLines, fileTitle) {
43
- const link = document.createElement("a");
44
- if (link.download !== undefined) {
45
- link.href = URL.createObjectURL(new Blob(outputLines, { type: "text/csv;charset=utf-8;" }));
46
- link.download = `${fileTitle}.csv` || "export.csv";
47
- link.style.visibility = "hidden";
48
- document.body.appendChild(link);
49
- link.click();
50
- document.body.removeChild(link);
51
- }
52
- }
53
-
54
- exports.exportCSV = exportCSV;
@@ -1,52 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- /** @license
7
- * Copyright 2022 Esri
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
- /**
22
- * Export a csv of the attributes from the features that match the provided ids
23
- *
24
- * @param labels Labels to write
25
- */
26
- function exportCSV(labels) {
27
- // Format values to string so it doesn't get tripped up when a value has a comma
28
- // another option could be to export with a different delimiter
29
- const outputLines = labels.map(label => Object.values(label).map(v => `"${v}"`).join(",") + "\r\n");
30
- _downloadCSVFile(outputLines, `notify-${Date.now().toString()}`);
31
- }
32
- /**
33
- * Download the CSV file
34
- *
35
- * @param outputLines Lines of output to write to file
36
- * @param fileTitle Title (without file extension) to use for file; defaults to "export"
37
- *
38
- * @see {@link https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2}
39
- */
40
- function _downloadCSVFile(outputLines, fileTitle) {
41
- const link = document.createElement("a");
42
- if (link.download !== undefined) {
43
- link.href = URL.createObjectURL(new Blob(outputLines, { type: "text/csv;charset=utf-8;" }));
44
- link.download = `${fileTitle}.csv` || "export.csv";
45
- link.style.visibility = "hidden";
46
- document.body.appendChild(link);
47
- link.click();
48
- document.body.removeChild(link);
49
- }
50
- }
51
-
52
- export { exportCSV as e };
@@ -1,52 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- /** @license
7
- * Copyright 2022 Esri
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
- /**
22
- * Export a csv of the attributes from the features that match the provided ids
23
- *
24
- * @param labels Labels to write
25
- */
26
- function exportCSV(labels) {
27
- // Format values to string so it doesn't get tripped up when a value has a comma
28
- // another option could be to export with a different delimiter
29
- const outputLines = labels.map(label => Object.values(label).map(v => `"${v}"`).join(",") + "\r\n");
30
- _downloadCSVFile(outputLines, `notify-${Date.now().toString()}`);
31
- }
32
- /**
33
- * Download the CSV file
34
- *
35
- * @param outputLines Lines of output to write to file
36
- * @param fileTitle Title (without file extension) to use for file; defaults to "export"
37
- *
38
- * @see {@link https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2}
39
- */
40
- function _downloadCSVFile(outputLines, fileTitle) {
41
- const link = document.createElement("a");
42
- if (link.download !== undefined) {
43
- link.href = URL.createObjectURL(new Blob(outputLines, { type: "text/csv;charset=utf-8;" }));
44
- link.download = `${fileTitle}.csv` || "export.csv";
45
- link.style.visibility = "hidden";
46
- document.body.appendChild(link);
47
- link.click();
48
- document.body.removeChild(link);
49
- }
50
- }
51
-
52
- export { exportCSV as e };
@@ -1,21 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- /** @license
7
- * Copyright 2022 Esri
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
- function t(t){!function(t,e){const n=document.createElement("a");void 0!==n.download&&(n.href=URL.createObjectURL(new Blob(t,{type:"text/csv;charset=utf-8;"})),n.download=`${e}.csv`||"export.csv",n.style.visibility="hidden",document.body.appendChild(n),n.click(),document.body.removeChild(n))}(t.map((t=>Object.values(t).map((t=>`"${t}"`)).join(",")+"\r\n")),`notify-${Date.now().toString()}`)}export{t as e}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,h as e,H as i,g as a}from"./p-c2f00d41.js";import{g as l}from"./p-9260d75a.js";import{q as s,g as r,a as c,b as o}from"./p-cc2e20c8.js";import{e as n}from"./p-3069e3b7.js";import"./p-e1a4994d.js";import"./p-dbc9a5a8.js";const d=class{constructor(e){t(this,e),this._graphics=[],this._fieldNames=[],this.mapView=void 0,this._translations=void 0,this._selectedIndexes=[]}async componentWillLoad(){await this._getTranslations()}render(){return e(i,null,this._getTableControlRow(),e("div",{class:"data-container"},e("div",{class:"table-container"},e("div",{class:"table"},this._getTableHeader(),this._getTableRows()))),e("edit-record-modal",{ref:t=>this._editMultipleMpdal=t}))}_getTableControlRow(){const t=this._selectedIndexes.length>0,i=this._selectedIndexes.length>1;return e("div",{class:"display-flex table-border"},e("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t)}),e("div",null,e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"magnifying-glass",onClick:()=>this._zoom()},this._translations.zoom),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!i,iconStart:"pencil",onClick:()=>this._editMultiple()},this._translations.editMultiple),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"trash",onClick:()=>this._delete()},this._translations.delete),e("calcite-split-button",{appearance:"transparent",color:"neutral","primary-text":this._translations.more},e("calcite-dropdown-group",{"selection-mode":"none"},e("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll(!0)},this._translations.selectAll),e("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._showSelected()},this._translations.showSelected),e("calcite-dropdown-item",{iconStart:"erase",onClick:()=>this._clearSelection()},this._translations.clearSelection),e("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),e("calcite-dropdown-item",{iconStart:"export",onClick:()=>this._exportToCSV()},this._translations.exportCSV)))))}_getTableHeader(){return e("div",{class:"header"},e("div",{class:"table-header-cell padding-3-4"},e("calcite-checkbox",{class:"display-flex justify-center",onClick:()=>this._selectAll(this._selectAllElement.checked),ref:t=>this._selectAllElement=t})),this._fieldNames.map((t=>this._getTableHeaderCell(t))))}_getTableHeaderCell(t){return e("div",{class:"table-header-cell field-width"},t)}_getTableRows(){return e("div",{class:"table-body"},this._graphics.map(((t,e)=>this._getTableRow(t,e))))}_getTableRow(t,i){const a=this._selectedIndexes.indexOf(i)>-1;return e("div",{class:"row"},e("div",{class:"table-cell table-border padding-3-4"},e("calcite-checkbox",{checked:a,class:"display-flex justify-center",onClick:()=>this._rowSelected(i),value:i})),this._fieldNames.map((e=>{const i=this._layerView.layer.fieldsIndex.get(e);return this._getTableRowCell(t.attributes[e],i,a)})))}_getTableRowCell(t,i,a){const l=i.editable&&a,s=this._getInputType(i.type);let r;const c=i.domain;return c&&(r="coded-value"===c.type?e("calcite-select",{label:""},c.codedValues.map((i=>e("calcite-option",{label:i.name,selected:t===i.code.toString(),value:i.code})))):e("calcite-input",{max:c.maxValue,min:c.minValue,type:"number",value:t})),e("div",{class:"table-cell table-border field-width"},l&&r?r:l?e("calcite-input",{type:s,value:t}):t)}_getInputType(t){const e={string:"text","small-integer":"number",integer:"number",single:"number",double:"number",long:"number",date:"datetime-local",oid:"number",guid:"text","global-id":"text"};return Object.keys(e).indexOf(t)>-1?e[t]:"text"}_selectAll(t){this._selectedIndexes=t?this._graphics.map(((t,e)=>e)):[]}_showSelected(){console.log("_showSelected")}_clearSelection(){this._selectedIndexes=[]}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._graphics.reduce(((e,i,a)=>(t.indexOf(a)<0&&e.push(a),e)),[])}async _exportToCSV(){const t=this._getSelectedIds(),e=(await s(t,this._layerView.layer)).features.map((t=>t.attributes)),i=[],a=e[0];return Object.keys(a).forEach((t=>{a.hasOwnProperty(t)&&i.push(t)})),e.unshift(i),n(e)}_zoom(){const t=this._getSelectedIds();r(t,this._layerView,this.mapView,!0)}_editMultiple(){this._editMultipleMpdal.open=!0}_delete(){console.log("delete")}_getGraphics(t){return this._graphics.filter(((e,i)=>t.indexOf(i)>-1))}_getSelectedIds(){return this._getGraphics(this._selectedIndexes).map((t=>t.getObjectId()))}_rowSelected(t){const e=this._selectedIndexes.indexOf(t);e>-1?(this._selectedIndexes.splice(e,1),this._selectedIndexes=[...this._selectedIndexes]):this._selectedIndexes=[...this._selectedIndexes,t]}async _layerSelectionChanged(t){const e=t.detail[0];this._layerView=await c(this.mapView,e),this._fieldNames=this._layerView.layer.fields.map((t=>t.alias||t.name)),this._graphics=await o(0,this._layerView.layer,[]),this._selectedIndexes=[]}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return a(this)}};d.style=":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";export{d as layer_table}