@esri/solutions-components 0.3.9 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +0 -2
  2. package/dist/assets/t9n/public-notification/resources_en.json +0 -2
  3. package/dist/cjs/buffer-tools_6.cjs.entry.js +5 -2
  4. package/dist/cjs/calcite-input-message_5.cjs.entry.js +1342 -18
  5. package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-cd8ad61e.js → downloadUtils-27dbd8b9.js} +205 -1337
  6. package/dist/cjs/{index.es-e89ba2a1.js → index.es-40d341ed.js} +3 -13
  7. package/dist/cjs/layer-table.cjs.entry.js +5 -15
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/public-notification.cjs.entry.js +23 -2
  10. package/dist/cjs/solutions-components.cjs.js +1 -1
  11. package/dist/collection/components/layer-table/layer-table.js +4 -16
  12. package/dist/collection/components/map-search/map-search.js +1 -1
  13. package/dist/collection/components/map-select-tools/map-select-tools.js +73 -17
  14. package/dist/collection/components/pdf-download/pdf-download.js +9 -76
  15. package/dist/collection/components/public-notification/public-notification.js +45 -3
  16. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  17. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +13 -5
  18. package/dist/collection/demos/buffer-tools.html +1 -1
  19. package/dist/collection/utils/csvUtils.js +4 -0
  20. package/dist/collection/utils/csvUtils.ts +7 -0
  21. package/dist/collection/utils/downloadUtils.js +181 -0
  22. package/dist/collection/utils/downloadUtils.ts +235 -0
  23. package/dist/collection/utils/interfaces.ts +8 -1
  24. package/dist/collection/utils/pdfUtils.js +7 -0
  25. package/dist/collection/utils/pdfUtils.ts +13 -2
  26. package/dist/components/downloadUtils.js +2279 -0
  27. package/dist/components/index.es.js +1 -1
  28. package/dist/components/layer-table.js +5 -16
  29. package/dist/components/map-layer-picker2.js +1 -1
  30. package/dist/components/map-search.js +1 -1
  31. package/dist/components/map-select-tools2.js +69 -19
  32. package/dist/components/pdf-download2.js +10 -2124
  33. package/dist/components/public-notification.js +24 -3
  34. package/dist/components/queryUtils.js +1 -1
  35. package/dist/components/refine-selection-tools2.js +6 -3
  36. package/dist/components/refine-selection2.js +1 -1
  37. package/dist/esm/buffer-tools_6.entry.js +6 -3
  38. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  39. package/dist/esm/calcite-input-message_5.entry.js +1341 -13
  40. package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-ddd74bd6.js → downloadUtils-76e38a94.js} +206 -1335
  41. package/dist/esm/{index.es-8edafdb2.js → index.es-489f4f08.js} +2 -12
  42. package/dist/esm/layer-table.entry.js +6 -16
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/esm/{mapViewUtils-63e118f8.js → mapViewUtils-02696ab6.js} +1 -1
  45. package/dist/esm/public-notification.entry.js +24 -3
  46. package/dist/esm/solutions-components.js +1 -1
  47. package/dist/solutions-components/demos/buffer-tools.html +1 -1
  48. package/dist/solutions-components/{p-cc2e20c8.js → p-1bfd07e3.js} +1 -1
  49. package/dist/solutions-components/{p-117174e8.entry.js → p-335fce8c.entry.js} +1 -1
  50. package/dist/solutions-components/p-4ef94c6b.entry.js +6 -0
  51. package/dist/solutions-components/p-5d27b47d.entry.js +17 -0
  52. package/dist/solutions-components/p-92cb569a.entry.js +6 -0
  53. package/dist/solutions-components/{p-2a96314a.entry.js → p-a3b60bc9.entry.js} +2 -2
  54. package/dist/solutions-components/{p-98884f44.js → p-bff8aa4e.js} +3 -3
  55. package/dist/solutions-components/p-caa7e7a7.js +437 -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 +235 -0
  59. package/dist/solutions-components/utils/interfaces.ts +8 -1
  60. package/dist/solutions-components/utils/pdfUtils.ts +13 -2
  61. package/dist/types/components/json-editor/assets/monaco-editor/monaco.d.ts +8262 -0
  62. package/dist/types/components/map-select-tools/map-select-tools.d.ts +19 -1
  63. package/dist/types/components/pdf-download/pdf-download.d.ts +0 -18
  64. package/dist/types/components/public-notification/public-notification.d.ts +10 -0
  65. package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +2 -2
  66. package/dist/types/components.d.ts +6 -2
  67. package/dist/types/preact.d.ts +2 -1
  68. package/dist/types/utils/downloadUtils.d.ts +40 -0
  69. package/dist/types/utils/interfaces.d.ts +6 -2
  70. package/dist/types/utils/pdfUtils.d.ts +3 -1
  71. package/package.json +1 -1
  72. package/dist/cjs/csvUtils-3a56c6d8.js +0 -54
  73. package/dist/components/csvUtils.js +0 -52
  74. package/dist/esm/csvUtils-23b5418f.js +0 -52
  75. package/dist/solutions-components/p-15f9b0a0.entry.js +0 -6
  76. package/dist/solutions-components/p-238db156.js +0 -416
  77. package/dist/solutions-components/p-3069e3b7.js +0 -21
  78. package/dist/solutions-components/p-6d28f991.entry.js +0 -6
  79. package/dist/solutions-components/p-c5341977.entry.js +0 -6
@@ -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}
@@ -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
- export{I as calcite_input_message,N as calcite_notice,M as map_select_tools,P as pdf_download,R as refine_selection}from"./p-238db156.js";import"./p-c2f00d41.js";import"./p-83166522.js";import"./p-729708a3.js";import"./p-a80b3880.js";import"./p-6fe17794.js";import"./p-1c247f54.js";import"./p-9a9955db.js";import"./p-eea93a37.js";import"./p-9260d75a.js";import"./p-e1a4994d.js";import"./p-cc2e20c8.js";import"./p-dbc9a5a8.js";import"./p-4557d5a8.js";import"./p-00444009.js";import"./p-3069e3b7.js";import"./p-fc884dd6.js";