@esri/calcite-components 1.0.0-next.412 → 1.0.0-next.413

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 (92) hide show
  1. package/dist/calcite/assets/icon/clockForward16.json +1 -0
  2. package/dist/calcite/assets/icon/clockForward24.json +1 -0
  3. package/dist/calcite/assets/icon/clockForward32.json +1 -0
  4. package/dist/calcite/assets/icon/contingentValues16.json +1 -0
  5. package/dist/calcite/assets/icon/contingentValues24.json +1 -0
  6. package/dist/calcite/assets/icon/contingentValues32.json +1 -0
  7. package/dist/calcite/assets/icon/creditCard16.json +1 -0
  8. package/dist/calcite/assets/icon/creditCard24.json +1 -0
  9. package/dist/calcite/assets/icon/creditCard32.json +1 -0
  10. package/dist/calcite/assets/icon/credits16.json +1 -1
  11. package/dist/calcite/assets/icon/credits24.json +1 -1
  12. package/dist/calcite/assets/icon/credits32.json +1 -1
  13. package/dist/calcite/assets/icon/keyboard16.json +1 -0
  14. package/dist/calcite/assets/icon/keyboard24.json +1 -0
  15. package/dist/calcite/assets/icon/keyboard32.json +1 -0
  16. package/dist/calcite/assets/icon/premiumContentUserCredit24.json +1 -1
  17. package/dist/calcite/assets/icon/premiumContentUserCredit32.json +1 -1
  18. package/dist/calcite/assets/icon/select16.json +1 -1
  19. package/dist/calcite/assets/icon/select24.json +1 -1
  20. package/dist/calcite/assets/icon/select32.json +1 -1
  21. package/dist/calcite/assets/icon/userDown16.json +1 -0
  22. package/dist/calcite/assets/icon/userDown24.json +1 -0
  23. package/dist/calcite/assets/icon/userDown32.json +1 -0
  24. package/dist/calcite/assets/icon/userKey16.json +1 -0
  25. package/dist/calcite/assets/icon/userKey24.json +1 -0
  26. package/dist/calcite/assets/icon/userKey32.json +1 -0
  27. package/dist/calcite/assets/icon/userMinus16.json +1 -0
  28. package/dist/calcite/assets/icon/userMinus24.json +1 -0
  29. package/dist/calcite/assets/icon/userMinus32.json +1 -0
  30. package/dist/calcite/assets/icon/userUp16.json +1 -0
  31. package/dist/calcite/assets/icon/userUp24.json +1 -0
  32. package/dist/calcite/assets/icon/userUp32.json +1 -0
  33. package/dist/calcite/assets/icon/userX16.json +1 -0
  34. package/dist/calcite/assets/icon/userX24.json +1 -0
  35. package/dist/calcite/assets/icon/userX32.json +1 -0
  36. package/dist/calcite/assets/icon/utilityNetworkTrace16.json +1 -0
  37. package/dist/calcite/assets/icon/utilityNetworkTrace24.json +1 -0
  38. package/dist/calcite/assets/icon/utilityNetworkTrace32.json +1 -0
  39. package/dist/calcite/calcite.esm.js +1 -1
  40. package/dist/calcite/p-8f93be14.system.js +1 -1
  41. package/dist/calcite/{p-383b48a0.system.entry.js → p-91b23d79.system.entry.js} +1 -1
  42. package/dist/calcite/p-a0ffad45.entry.js +5 -0
  43. package/dist/cjs/calcite-filter.cjs.entry.js +24 -0
  44. package/dist/collection/components/filter/filter.js +30 -4
  45. package/dist/collection/components/icon/assets/icon/clockForward16.json +1 -0
  46. package/dist/collection/components/icon/assets/icon/clockForward24.json +1 -0
  47. package/dist/collection/components/icon/assets/icon/clockForward32.json +1 -0
  48. package/dist/collection/components/icon/assets/icon/contingentValues16.json +1 -0
  49. package/dist/collection/components/icon/assets/icon/contingentValues24.json +1 -0
  50. package/dist/collection/components/icon/assets/icon/contingentValues32.json +1 -0
  51. package/dist/collection/components/icon/assets/icon/creditCard16.json +1 -0
  52. package/dist/collection/components/icon/assets/icon/creditCard24.json +1 -0
  53. package/dist/collection/components/icon/assets/icon/creditCard32.json +1 -0
  54. package/dist/collection/components/icon/assets/icon/credits16.json +1 -1
  55. package/dist/collection/components/icon/assets/icon/credits24.json +1 -1
  56. package/dist/collection/components/icon/assets/icon/credits32.json +1 -1
  57. package/dist/collection/components/icon/assets/icon/keyboard16.json +1 -0
  58. package/dist/collection/components/icon/assets/icon/keyboard24.json +1 -0
  59. package/dist/collection/components/icon/assets/icon/keyboard32.json +1 -0
  60. package/dist/collection/components/icon/assets/icon/premiumContentUserCredit24.json +1 -1
  61. package/dist/collection/components/icon/assets/icon/premiumContentUserCredit32.json +1 -1
  62. package/dist/collection/components/icon/assets/icon/select16.json +1 -1
  63. package/dist/collection/components/icon/assets/icon/select24.json +1 -1
  64. package/dist/collection/components/icon/assets/icon/select32.json +1 -1
  65. package/dist/collection/components/icon/assets/icon/userDown16.json +1 -0
  66. package/dist/collection/components/icon/assets/icon/userDown24.json +1 -0
  67. package/dist/collection/components/icon/assets/icon/userDown32.json +1 -0
  68. package/dist/collection/components/icon/assets/icon/userKey16.json +1 -0
  69. package/dist/collection/components/icon/assets/icon/userKey24.json +1 -0
  70. package/dist/collection/components/icon/assets/icon/userKey32.json +1 -0
  71. package/dist/collection/components/icon/assets/icon/userMinus16.json +1 -0
  72. package/dist/collection/components/icon/assets/icon/userMinus24.json +1 -0
  73. package/dist/collection/components/icon/assets/icon/userMinus32.json +1 -0
  74. package/dist/collection/components/icon/assets/icon/userUp16.json +1 -0
  75. package/dist/collection/components/icon/assets/icon/userUp24.json +1 -0
  76. package/dist/collection/components/icon/assets/icon/userUp32.json +1 -0
  77. package/dist/collection/components/icon/assets/icon/userX16.json +1 -0
  78. package/dist/collection/components/icon/assets/icon/userX24.json +1 -0
  79. package/dist/collection/components/icon/assets/icon/userX32.json +1 -0
  80. package/dist/collection/components/icon/assets/icon/utilityNetworkTrace16.json +1 -0
  81. package/dist/collection/components/icon/assets/icon/utilityNetworkTrace24.json +1 -0
  82. package/dist/collection/components/icon/assets/icon/utilityNetworkTrace32.json +1 -0
  83. package/dist/components/filter.js +24 -0
  84. package/dist/custom-elements/index.js +24 -0
  85. package/dist/esm/calcite-filter.entry.js +24 -0
  86. package/dist/esm-es5/calcite-filter.entry.js +1 -1
  87. package/dist/extras/docs-json.json +5 -3
  88. package/dist/types/components/filter/filter.d.ts +2 -1
  89. package/dist/types/components.d.ts +2 -2
  90. package/hydrate/index.js +24 -0
  91. package/package.json +6 -7
  92. package/dist/calcite/p-e7dd0a9f.entry.js +0 -5
@@ -35,6 +35,18 @@ let Filter = class extends HTMLElement {
35
35
  this.__registerHost();
36
36
  this.__attachShadow();
37
37
  this.calciteFilterChange = createEvent(this, "calciteFilterChange", 7);
38
+ // --------------------------------------------------------------------------
39
+ //
40
+ // Properties
41
+ //
42
+ // --------------------------------------------------------------------------
43
+ /**
44
+ * The items to filter through. The filter uses this as the starting point, and returns items
45
+ * that contain the string entered in the input, using a partial match and recursive search.
46
+ *
47
+ * This property is required.
48
+ */
49
+ this.items = [];
38
50
  /**
39
51
  * When true, disabled prevents interaction. This state shows items with lower opacity/grayed.
40
52
  */
@@ -47,6 +59,10 @@ let Filter = class extends HTMLElement {
47
59
  this.filteredItems = [];
48
60
  /** specify the scale of filter, defaults to m */
49
61
  this.scale = "m";
62
+ /**
63
+ * Filter value.
64
+ */
65
+ this.value = "";
50
66
  // --------------------------------------------------------------------------
51
67
  //
52
68
  // Private Methods
@@ -100,6 +116,14 @@ let Filter = class extends HTMLElement {
100
116
  valueHandler(value) {
101
117
  this.filter(value);
102
118
  }
119
+ //--------------------------------------------------------------------------
120
+ //
121
+ // Lifecycle
122
+ //
123
+ //--------------------------------------------------------------------------
124
+ componentWillLoad() {
125
+ this.filter(this.value);
126
+ }
103
127
  // --------------------------------------------------------------------------
104
128
  //
105
129
  // Public Methods
@@ -12132,6 +12132,18 @@ let Filter = class extends HTMLElement$1 {
12132
12132
  this.__registerHost();
12133
12133
  this.__attachShadow();
12134
12134
  this.calciteFilterChange = createEvent(this, "calciteFilterChange", 7);
12135
+ // --------------------------------------------------------------------------
12136
+ //
12137
+ // Properties
12138
+ //
12139
+ // --------------------------------------------------------------------------
12140
+ /**
12141
+ * The items to filter through. The filter uses this as the starting point, and returns items
12142
+ * that contain the string entered in the input, using a partial match and recursive search.
12143
+ *
12144
+ * This property is required.
12145
+ */
12146
+ this.items = [];
12135
12147
  /**
12136
12148
  * When true, disabled prevents interaction. This state shows items with lower opacity/grayed.
12137
12149
  */
@@ -12144,6 +12156,10 @@ let Filter = class extends HTMLElement$1 {
12144
12156
  this.filteredItems = [];
12145
12157
  /** specify the scale of filter, defaults to m */
12146
12158
  this.scale = "m";
12159
+ /**
12160
+ * Filter value.
12161
+ */
12162
+ this.value = "";
12147
12163
  // --------------------------------------------------------------------------
12148
12164
  //
12149
12165
  // Private Methods
@@ -12197,6 +12213,14 @@ let Filter = class extends HTMLElement$1 {
12197
12213
  valueHandler(value) {
12198
12214
  this.filter(value);
12199
12215
  }
12216
+ //--------------------------------------------------------------------------
12217
+ //
12218
+ // Lifecycle
12219
+ //
12220
+ //--------------------------------------------------------------------------
12221
+ componentWillLoad() {
12222
+ this.filter(this.value);
12223
+ }
12200
12224
  // --------------------------------------------------------------------------
12201
12225
  //
12202
12226
  // Public Methods
@@ -29,6 +29,18 @@ let Filter = class {
29
29
  constructor(hostRef) {
30
30
  registerInstance(this, hostRef);
31
31
  this.calciteFilterChange = createEvent(this, "calciteFilterChange", 7);
32
+ // --------------------------------------------------------------------------
33
+ //
34
+ // Properties
35
+ //
36
+ // --------------------------------------------------------------------------
37
+ /**
38
+ * The items to filter through. The filter uses this as the starting point, and returns items
39
+ * that contain the string entered in the input, using a partial match and recursive search.
40
+ *
41
+ * This property is required.
42
+ */
43
+ this.items = [];
32
44
  /**
33
45
  * When true, disabled prevents interaction. This state shows items with lower opacity/grayed.
34
46
  */
@@ -41,6 +53,10 @@ let Filter = class {
41
53
  this.filteredItems = [];
42
54
  /** specify the scale of filter, defaults to m */
43
55
  this.scale = "m";
56
+ /**
57
+ * Filter value.
58
+ */
59
+ this.value = "";
44
60
  // --------------------------------------------------------------------------
45
61
  //
46
62
  // Private Methods
@@ -94,6 +110,14 @@ let Filter = class {
94
110
  valueHandler(value) {
95
111
  this.filter(value);
96
112
  }
113
+ //--------------------------------------------------------------------------
114
+ //
115
+ // Lifecycle
116
+ //
117
+ //--------------------------------------------------------------------------
118
+ componentWillLoad() {
119
+ this.filter(this.value);
120
+ }
97
121
  // --------------------------------------------------------------------------
98
122
  //
99
123
  // Public Methods
@@ -2,4 +2,4 @@ var __awaiter=this&&this.__awaiter||function(t,e,i,a){function n(t){return t ins
2
2
  /*!
3
3
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
4
4
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
5
- */import{r as registerInstance,c as createEvent,h,F as Fragment,g as getElement}from"./index-0fefddd1.js";import{f as focusElement}from"./dom-e7fa77b9.js";import{d as debounce}from"./debounce-79648d42.js";import{f as forIn}from"./forIn-48d8fb84.js";import"./guid-196bd5ea.js";var CSS={container:"container",searchIcon:"search-icon",clearButton:"clear-button"};var TEXT={filterLabel:"Filter",clear:"Clear filter"};var ICONS={search:"search",close:"x"};var filterCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;width:100%}.container{display:-ms-flexbox;display:flex;width:100%;padding:0.5rem}label{position:relative;margin-left:0.25rem;margin-right:0.25rem;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;overflow:hidden}input[type=text]{margin-bottom:0.25rem;width:100%;border-style:none;background-color:transparent;padding-top:0.25rem;padding-bottom:0.25rem;padding-right:0.25rem;padding-left:1.5rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);-webkit-transition:padding var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{width:100%}.search-icon{position:absolute;display:-ms-flexbox;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;-webkit-transition:left var(--calcite-animation-timing), right var(--calcite-animation-timing), opacity var(--calcite-animation-timing);transition:left var(--calcite-animation-timing), right var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}";var filterDebounceInMs=250;var Filter=function(){function t(t){var e=this;registerInstance(this,t);this.calciteFilterChange=createEvent(this,"calciteFilterChange",7);this.disabled=false;this.filteredItems=[];this.scale="m";this.filter=debounce((function(t){var i=new RegExp(t,"i");if(e.items.length===0){e.updateFiltered([]);return}var a=function(t,e){var i=false;forIn(t,(function(t){if(typeof t==="function"){return}if(Array.isArray(t)||typeof t==="object"&&t!==null){if(a(t,e)){i=true}}else if(e.test(t)){i=true}}));return i};var n=e.items.filter((function(t){return a(t,i)}));e.updateFiltered(n)}),filterDebounceInMs);this.inputHandler=function(t){var i=t.target;e.value=i.value};this.keyDownHandler=function(t){var i=t.key;if(i==="Escape"){e.clear()}};this.clear=function(){e.value="";e.setFocus()}}t.prototype.watchItemsHandler=function(){this.filter(this.value)};t.prototype.valueHandler=function(t){this.filter(t)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){focusElement(this.textInput);return[2]}))}))};t.prototype.updateFiltered=function(t){this.filteredItems.length=0;this.filteredItems=this.filteredItems.concat(t);this.calciteFilterChange.emit()};t.prototype.render=function(){var t=this;var e=this,i=e.disabled,a=e.scale;return h(Fragment,null,i?h("calcite-scrim",null):null,h("div",{class:CSS.container},h("label",null,h("calcite-input",{"aria-label":this.intlLabel||TEXT.filterLabel,disabled:this.disabled,icon:ICONS.search,onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:function(e){t.textInput=e},scale:a,type:"text",value:this.value})),this.value?h("button",{"aria-label":this.intlClear||TEXT.clear,class:CSS.clearButton,onClick:this.clear},h("calcite-icon",{icon:ICONS.close,scale:a})):null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{items:["watchItemsHandler"],value:["valueHandler"]}},enumerable:false,configurable:true});return t}();Filter.style=filterCss;export{Filter as calcite_filter};
5
+ */import{r as registerInstance,c as createEvent,h,F as Fragment,g as getElement}from"./index-0fefddd1.js";import{f as focusElement}from"./dom-e7fa77b9.js";import{d as debounce}from"./debounce-79648d42.js";import{f as forIn}from"./forIn-48d8fb84.js";import"./guid-196bd5ea.js";var CSS={container:"container",searchIcon:"search-icon",clearButton:"clear-button"};var TEXT={filterLabel:"Filter",clear:"Clear filter"};var ICONS={search:"search",close:"x"};var filterCss="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;width:100%}.container{display:-ms-flexbox;display:flex;width:100%;padding:0.5rem}label{position:relative;margin-left:0.25rem;margin-right:0.25rem;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;overflow:hidden}input[type=text]{margin-bottom:0.25rem;width:100%;border-style:none;background-color:transparent;padding-top:0.25rem;padding-bottom:0.25rem;padding-right:0.25rem;padding-left:1.5rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);-webkit-transition:padding var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{width:100%}.search-icon{position:absolute;display:-ms-flexbox;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;-webkit-transition:left var(--calcite-animation-timing), right var(--calcite-animation-timing), opacity var(--calcite-animation-timing);transition:left var(--calcite-animation-timing), right var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}";var filterDebounceInMs=250;var Filter=function(){function t(t){var e=this;registerInstance(this,t);this.calciteFilterChange=createEvent(this,"calciteFilterChange",7);this.items=[];this.disabled=false;this.filteredItems=[];this.scale="m";this.value="";this.filter=debounce((function(t){var i=new RegExp(t,"i");if(e.items.length===0){e.updateFiltered([]);return}var a=function(t,e){var i=false;forIn(t,(function(t){if(typeof t==="function"){return}if(Array.isArray(t)||typeof t==="object"&&t!==null){if(a(t,e)){i=true}}else if(e.test(t)){i=true}}));return i};var n=e.items.filter((function(t){return a(t,i)}));e.updateFiltered(n)}),filterDebounceInMs);this.inputHandler=function(t){var i=t.target;e.value=i.value};this.keyDownHandler=function(t){var i=t.key;if(i==="Escape"){e.clear()}};this.clear=function(){e.value="";e.setFocus()}}t.prototype.watchItemsHandler=function(){this.filter(this.value)};t.prototype.valueHandler=function(t){this.filter(t)};t.prototype.componentWillLoad=function(){this.filter(this.value)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){focusElement(this.textInput);return[2]}))}))};t.prototype.updateFiltered=function(t){this.filteredItems.length=0;this.filteredItems=this.filteredItems.concat(t);this.calciteFilterChange.emit()};t.prototype.render=function(){var t=this;var e=this,i=e.disabled,a=e.scale;return h(Fragment,null,i?h("calcite-scrim",null):null,h("div",{class:CSS.container},h("label",null,h("calcite-input",{"aria-label":this.intlLabel||TEXT.filterLabel,disabled:this.disabled,icon:ICONS.search,onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:function(e){t.textInput=e},scale:a,type:"text",value:this.value})),this.value?h("button",{"aria-label":this.intlClear||TEXT.clear,class:CSS.clearButton,onClick:this.clear},h("calcite-icon",{icon:ICONS.close,scale:a})):null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{items:["watchItemsHandler"],value:["valueHandler"]}},enumerable:false,configurable:true});return t}();Filter.style=filterCss;export{Filter as calcite_filter};
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-03-04T22:31:23",
2
+ "timestamp": "2022-03-07T23:14:53",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.14.0",
@@ -7466,13 +7466,14 @@
7466
7466
  "reflectToAttr": false,
7467
7467
  "docs": "The items to filter through. The filter uses this as the starting point, and returns items\nthat contain the string entered in the input, using a partial match and recursive search.\n\nThis property is required.",
7468
7468
  "docsTags": [],
7469
+ "default": "[]",
7469
7470
  "values": [
7470
7471
  {
7471
7472
  "type": "object[]"
7472
7473
  }
7473
7474
  ],
7474
7475
  "optional": false,
7475
- "required": true
7476
+ "required": false
7476
7477
  },
7477
7478
  {
7478
7479
  "name": "placeholder",
@@ -7524,12 +7525,13 @@
7524
7525
  "reflectToAttr": false,
7525
7526
  "docs": "Filter value.",
7526
7527
  "docsTags": [],
7528
+ "default": "\"\"",
7527
7529
  "values": [
7528
7530
  {
7529
7531
  "type": "string"
7530
7532
  }
7531
7533
  ],
7532
- "optional": true,
7534
+ "optional": false,
7533
7535
  "required": false
7534
7536
  }
7535
7537
  ],
@@ -37,7 +37,7 @@ export declare class Filter {
37
37
  /**
38
38
  * Filter value.
39
39
  */
40
- value?: string;
40
+ value: string;
41
41
  valueHandler(value: string): void;
42
42
  el: HTMLCalciteFilterElement;
43
43
  textInput: HTMLCalciteInputElement;
@@ -45,6 +45,7 @@ export declare class Filter {
45
45
  * This event fires when the filter text changes.
46
46
  */
47
47
  calciteFilterChange: EventEmitter<void>;
48
+ componentWillLoad(): void;
48
49
  /** Sets focus on the component. */
49
50
  setFocus(): Promise<void>;
50
51
  filter: import("lodash").DebouncedFunc<(value: string) => void>;
@@ -1323,7 +1323,7 @@ export namespace Components {
1323
1323
  /**
1324
1324
  * Filter value.
1325
1325
  */
1326
- "value"?: string;
1326
+ "value": string;
1327
1327
  }
1328
1328
  interface CalciteFlow {
1329
1329
  /**
@@ -5418,7 +5418,7 @@ declare namespace LocalJSX {
5418
5418
  /**
5419
5419
  * The items to filter through. The filter uses this as the starting point, and returns items that contain the string entered in the input, using a partial match and recursive search. This property is required.
5420
5420
  */
5421
- "items": object[];
5421
+ "items"?: object[];
5422
5422
  /**
5423
5423
  * This event fires when the filter text changes.
5424
5424
  */
package/hydrate/index.js CHANGED
@@ -18149,6 +18149,18 @@ class Filter {
18149
18149
  constructor(hostRef) {
18150
18150
  registerInstance(this, hostRef);
18151
18151
  this.calciteFilterChange = createEvent(this, "calciteFilterChange", 7);
18152
+ // --------------------------------------------------------------------------
18153
+ //
18154
+ // Properties
18155
+ //
18156
+ // --------------------------------------------------------------------------
18157
+ /**
18158
+ * The items to filter through. The filter uses this as the starting point, and returns items
18159
+ * that contain the string entered in the input, using a partial match and recursive search.
18160
+ *
18161
+ * This property is required.
18162
+ */
18163
+ this.items = [];
18152
18164
  /**
18153
18165
  * When true, disabled prevents interaction. This state shows items with lower opacity/grayed.
18154
18166
  */
@@ -18161,6 +18173,10 @@ class Filter {
18161
18173
  this.filteredItems = [];
18162
18174
  /** specify the scale of filter, defaults to m */
18163
18175
  this.scale = "m";
18176
+ /**
18177
+ * Filter value.
18178
+ */
18179
+ this.value = "";
18164
18180
  // --------------------------------------------------------------------------
18165
18181
  //
18166
18182
  // Private Methods
@@ -18214,6 +18230,14 @@ class Filter {
18214
18230
  valueHandler(value) {
18215
18231
  this.filter(value);
18216
18232
  }
18233
+ //--------------------------------------------------------------------------
18234
+ //
18235
+ // Lifecycle
18236
+ //
18237
+ //--------------------------------------------------------------------------
18238
+ componentWillLoad() {
18239
+ this.filter(this.value);
18240
+ }
18217
18241
  // --------------------------------------------------------------------------
18218
18242
  //
18219
18243
  // Public Methods
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/calcite-components",
3
- "version": "1.0.0-next.412",
3
+ "version": "1.0.0-next.413",
4
4
  "description": "Web Components for Esri's Calcite Design System.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -72,7 +72,7 @@
72
72
  "@babel/preset-react": "7.16.7",
73
73
  "@esri/calcite-base": "^1.2.0",
74
74
  "@esri/calcite-colors": "6.0.1",
75
- "@esri/calcite-ui-icons": "3.18.4",
75
+ "@esri/calcite-ui-icons": "3.18.6",
76
76
  "@esri/eslint-plugin-calcite-components": "0.1.4",
77
77
  "@rollup/plugin-babel": "5.3.1",
78
78
  "@stencil/eslint-plugin": "0.4.0",
@@ -95,7 +95,7 @@
95
95
  "@types/shell-quote": "1.7.1",
96
96
  "@types/sortablejs": "1.10.7",
97
97
  "@types/standard-version": "7.0.1",
98
- "@types/yargs": "17.0.8",
98
+ "@types/yargs": "17.0.9",
99
99
  "@typescript-eslint/eslint-plugin": "5.13.0",
100
100
  "@typescript-eslint/parser": "5.13.0",
101
101
  "@whitespace/storybook-addon-html": "5.0.0",
@@ -109,11 +109,11 @@
109
109
  "conventional-changelog-cli": "2.2.2",
110
110
  "cpy-cli": "^4.0.0",
111
111
  "dedent": "0.7.0",
112
- "eslint": "8.9.0",
112
+ "eslint": "8.10.0",
113
113
  "eslint-config-prettier": "8.5.0",
114
114
  "eslint-plugin-jest": "26.1.1",
115
115
  "eslint-plugin-prettier": "4.0.0",
116
- "eslint-plugin-react": "7.28.0",
116
+ "eslint-plugin-react": "7.29.3",
117
117
  "eslint-plugin-unicorn": "41.0.0",
118
118
  "gh-release": "6.0.1",
119
119
  "git-semver-tags": "4.1.1",
@@ -124,7 +124,6 @@
124
124
  "lint-staged": "12.3.4",
125
125
  "pify": "5.0.0",
126
126
  "postcss": "8.4.7",
127
- "posthtml": "0.16.5",
128
127
  "prettier": "2.5.1",
129
128
  "puppeteer": "10.0.0",
130
129
  "rimraf": "3.0.2",
@@ -143,7 +142,7 @@
143
142
  "ts-node": "10.6.0",
144
143
  "typescript": "4.5.4",
145
144
  "updtr": "4.0.0",
146
- "workbox-build": "6.5.0",
145
+ "workbox-build": "6.5.1",
147
146
  "yargs": "17.3.1"
148
147
  },
149
148
  "license": "SEE LICENSE IN copyright.txt",
@@ -1,5 +0,0 @@
1
- /*!
2
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
- */
5
- import{r as t,c as i,h as a,F as n,g as e}from"./p-362522e5.js";import{f as r}from"./p-8f3a3e4e.js";import{d as o}from"./p-b06207bb.js";import{f as s}from"./p-05bf835f.js";import"./p-8a63221d.js";let c=class{constructor(a){t(this,a),this.calciteFilterChange=i(this,"calciteFilterChange",7),this.disabled=!1,this.filteredItems=[],this.scale="m",this.filter=o((t=>{const i=new RegExp(t,"i");if(0===this.items.length)return void this.updateFiltered([]);const a=(t,i)=>{let n=!1;return s(t,(t=>{"function"!=typeof t&&(Array.isArray(t)||"object"==typeof t&&null!==t?a(t,i)&&(n=!0):i.test(t)&&(n=!0))})),n},n=this.items.filter((t=>a(t,i)));this.updateFiltered(n)}),250),this.inputHandler=t=>{this.value=t.target.value},this.keyDownHandler=({key:t})=>{"Escape"===t&&this.clear()},this.clear=()=>{this.value="",this.setFocus()}}watchItemsHandler(){this.filter(this.value)}valueHandler(t){this.filter(t)}async setFocus(){r(this.textInput)}updateFiltered(t){this.filteredItems.length=0,this.filteredItems=this.filteredItems.concat(t),this.calciteFilterChange.emit()}render(){const{disabled:t,scale:i}=this;return a(n,null,t?a("calcite-scrim",null):null,a("div",{class:"container"},a("label",null,a("calcite-input",{"aria-label":this.intlLabel||"Filter",disabled:this.disabled,icon:"search",onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:t=>{this.textInput=t},scale:i,type:"text",value:this.value})),this.value?a("button",{"aria-label":this.intlClear||"Clear filter",class:"clear-button",onClick:this.clear},a("calcite-icon",{icon:"x",scale:i})):null))}get el(){return e(this)}static get watchers(){return{items:["watchItemsHandler"],value:["valueHandler"]}}};c.style="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;width:100%}.container{display:-ms-flexbox;display:flex;width:100%;padding:0.5rem}label{position:relative;margin-left:0.25rem;margin-right:0.25rem;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;overflow:hidden}input[type=text]{margin-bottom:0.25rem;width:100%;border-style:none;background-color:transparent;padding-top:0.25rem;padding-bottom:0.25rem;padding-right:0.25rem;padding-left:1.5rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);-webkit-transition:padding var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing);transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing), -webkit-box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{width:100%}.search-icon{position:absolute;display:-ms-flexbox;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;-webkit-transition:left var(--calcite-animation-timing), right var(--calcite-animation-timing), opacity var(--calcite-animation-timing);transition:left var(--calcite-animation-timing), right var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}";export{c as calcite_filter}