smoothly 0.3.59 → 0.3.61

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 (52) hide show
  1. package/dist/cjs/{Listenable-fcea5136.js → Listenable-e157f34c.js} +6 -5
  2. package/dist/cjs/{index-8352a4e0.js → index-48630c3c.js} +3 -0
  3. package/dist/cjs/{index-679a68de.js → index-5c256daf.js} +1 -1
  4. package/dist/cjs/index.cjs.js +11 -3
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/smoothly-accordion_53.cjs.entry.js +16 -13
  7. package/dist/cjs/smoothly-country.cjs.entry.js +1 -1
  8. package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
  9. package/dist/cjs/smoothly-radio-group.cjs.entry.js +1 -1
  10. package/dist/cjs/smoothly-reorder.cjs.entry.js +4 -4
  11. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -2
  12. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -2
  13. package/dist/cjs/smoothly.cjs.js +1 -1
  14. package/dist/collection/components/menu-options/index.js +12 -4
  15. package/dist/collection/components/picker/index.js +1 -6
  16. package/dist/collection/index.js +1 -1
  17. package/dist/collection/model/Listenable.js +6 -5
  18. package/dist/collection/model/StateBase.js +7 -0
  19. package/dist/collection/model/index.js +1 -0
  20. package/dist/custom-elements/index.js +27 -16
  21. package/dist/esm/{Listenable-10f48463.js → Listenable-afd6cd7e.js} +6 -5
  22. package/dist/esm/{index-990cc22d.js → index-62de77e7.js} +1 -1
  23. package/dist/esm/{index-7b57a52c.js → index-e9e4cadb.js} +3 -1
  24. package/dist/esm/index.js +12 -5
  25. package/dist/esm/loader.js +2 -2
  26. package/dist/esm/smoothly-accordion_53.entry.js +16 -13
  27. package/dist/esm/smoothly-country.entry.js +1 -1
  28. package/dist/esm/smoothly-google-font.entry.js +1 -1
  29. package/dist/esm/smoothly-radio-group.entry.js +1 -1
  30. package/dist/esm/smoothly-reorder.entry.js +2 -2
  31. package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
  32. package/dist/esm/smoothly-trigger-source.entry.js +2 -2
  33. package/dist/esm/smoothly.js +2 -2
  34. package/dist/smoothly/index.esm.js +1 -1
  35. package/dist/smoothly/{p-bb57ff51.js → p-05154935.js} +1 -1
  36. package/dist/smoothly/{p-f0aa4247.entry.js → p-46dcb025.entry.js} +1 -1
  37. package/dist/smoothly/p-4f3b0e6d.entry.js +1 -0
  38. package/dist/smoothly/{p-43eb7034.entry.js → p-6e017bc2.entry.js} +1 -1
  39. package/dist/smoothly/{p-675a8d09.js → p-73bcae40.js} +1 -1
  40. package/dist/smoothly/{p-0ed63b7b.entry.js → p-b3d699d2.entry.js} +1 -1
  41. package/dist/smoothly/{p-a19a824a.entry.js → p-cab954af.entry.js} +1 -1
  42. package/dist/smoothly/{p-ab11639c.entry.js → p-ccd08c26.entry.js} +1 -1
  43. package/dist/smoothly/{p-c88ae468.js → p-e5d867e5.js} +2 -2
  44. package/dist/smoothly/{p-5fb08944.entry.js → p-fe4520be.entry.js} +1 -1
  45. package/dist/smoothly/smoothly.esm.js +1 -1
  46. package/dist/types/components/menu-options/index.d.ts +1 -0
  47. package/dist/types/index.d.ts +1 -1
  48. package/dist/types/model/Listenable.d.ts +10 -3
  49. package/dist/types/model/StateBase.d.ts +6 -0
  50. package/dist/types/model/index.d.ts +2 -1
  51. package/package.json +1 -1
  52. package/dist/smoothly/p-607abd83.entry.js +0 -1
@@ -784,18 +784,19 @@ class Listenable {
784
784
  constructor() {
785
785
  _Listenable_listeners.set(this, {});
786
786
  }
787
- listen(property, listener) {
787
+ listen(property, listener, options) {
788
788
  var _a, _b;
789
789
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
790
- listener(this[property]);
790
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
791
+ listener(this[property]);
791
792
  }
792
793
  unlisten(property, listener) {
793
794
  var _a, _b;
794
795
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
795
796
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
796
797
  }
797
- static load(backend, listenable) {
798
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
798
+ static load(backend) {
799
+ const result = backend.listenable;
799
800
  return Object.defineProperties(result, getProperties(backend));
800
801
  function getProperties(backend) {
801
802
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -819,7 +820,7 @@ class Listenable {
819
820
  }
820
821
  : {
821
822
  get() {
822
- return backend[name].bind(backend);
823
+ return backend[name];
823
824
  },
824
825
  },
825
826
  ]));
@@ -2060,6 +2060,8 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2060
2060
  const styles = /*@__PURE__*/ new Map();
2061
2061
  const win = typeof window !== 'undefined' ? window : {};
2062
2062
  const doc = win.document || { head: {} };
2063
+ const H = (win.HTMLElement || class {
2064
+ });
2063
2065
  const plt = {
2064
2066
  $flags$: 0,
2065
2067
  $resourcesUrl$: '',
@@ -2122,6 +2124,7 @@ const flush = () => {
2122
2124
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
2123
2125
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2124
2126
 
2127
+ exports.H = H;
2125
2128
  exports.Host = Host;
2126
2129
  exports.bootstrapLazy = bootstrapLazy;
2127
2130
  exports.createEvent = createEvent;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-8352a4e0.js');
3
+ const index = require('./index-48630c3c.js');
4
4
 
5
5
  const appendToMap = (map, propName, value) => {
6
6
  const items = map.get(propName);
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-679a68de.js');
6
- const Listenable = require('./Listenable-fcea5136.js');
5
+ const index = require('./index-5c256daf.js');
6
+ const Listenable = require('./Listenable-e157f34c.js');
7
7
  const GoogleFont = require('./GoogleFont-6c4f0da1.js');
8
- require('./index-8352a4e0.js');
8
+ require('./index-48630c3c.js');
9
9
 
10
10
  class ClientIdentifier {
11
11
  constructor() { }
@@ -19,6 +19,13 @@ class ClientIdentifier {
19
19
  }
20
20
  }
21
21
 
22
+ class StateBase {
23
+ constructor(...parameters) {
24
+ this.listenable = new Listenable.Listenable();
25
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
26
+ }
27
+ }
28
+
22
29
  exports.App = index.App;
23
30
  Object.defineProperty(exports, 'Cosmetic', {
24
31
  enumerable: true,
@@ -44,3 +51,4 @@ Object.defineProperty(exports, 'GoogleFont', {
44
51
  }
45
52
  });
46
53
  exports.ClientIdentifier = ClientIdentifier;
54
+ exports.StateBase = StateBase;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
5
+ const index = require('./index-48630c3c.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
6
- const index$1 = require('./index-679a68de.js');
7
- const Listenable = require('./Listenable-fcea5136.js');
5
+ const index = require('./index-48630c3c.js');
6
+ const index$1 = require('./index-5c256daf.js');
7
+ const Listenable = require('./Listenable-e157f34c.js');
8
8
  require('./GoogleFont-6c4f0da1.js');
9
9
  const getLanguage = require('./getLanguage-7991c46a.js');
10
10
 
@@ -3082,14 +3082,22 @@ const SmoothlyMenuOptions = class {
3082
3082
  this.keyword = keyword;
3083
3083
  const keywordLowercase = keyword.toLowerCase();
3084
3084
  this.filteredOptions = [];
3085
- for (const option of this.options) {
3086
- const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
3087
- const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
3088
- isVisible && this.filteredOptions.push(option);
3085
+ if (keywordLowercase == "") {
3086
+ this.showAllOptions();
3087
+ }
3088
+ else {
3089
+ for (const option of this.options) {
3090
+ const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
3091
+ const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
3092
+ isVisible && this.filteredOptions.push(option);
3093
+ }
3089
3094
  }
3090
3095
  this.menuEmpty.emit(!this.filteredOptions.length);
3091
3096
  this.order && this.sortOptions(keyword);
3092
3097
  }
3098
+ showAllOptions() {
3099
+ this.filteredOptions = [...this.options];
3100
+ }
3093
3101
  sortOptions(keyword) {
3094
3102
  const keywordLowercase = keyword.toLowerCase();
3095
3103
  this.filteredOptions.sort((a, b) => {
@@ -3351,8 +3359,6 @@ const SmoothlyPicker = class {
3351
3359
  const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
3352
3360
  if (isNewSelection)
3353
3361
  this.selections = this.multiple ? [...this.selections, selection] : [selection];
3354
- this.inputElement.value = "";
3355
- this.filterOptions();
3356
3362
  this.keepFocusOnReRender = true;
3357
3363
  this.isOpen = this.multiple;
3358
3364
  }
@@ -3396,7 +3402,6 @@ const SmoothlyPicker = class {
3396
3402
  else if (event.key == "Escape") {
3397
3403
  this.inputElement.value = "";
3398
3404
  this.isOpen = false;
3399
- this.filterOptions();
3400
3405
  }
3401
3406
  else if (event.key == " " && this.inputElement.value == "") {
3402
3407
  event.preventDefault();
@@ -3409,13 +3414,11 @@ const SmoothlyPicker = class {
3409
3414
  this.isOpen = !this.isOpen;
3410
3415
  this.inputElement.focus();
3411
3416
  this.highlightDefault();
3412
- this.filterOptions();
3413
3417
  }
3414
3418
  }
3415
3419
  onBlur() {
3416
3420
  this.inputElement.value = "";
3417
3421
  this.isOpen = false;
3418
- this.filterOptions();
3419
3422
  }
3420
3423
  render() {
3421
3424
  var _a, _b, _c;
@@ -3442,7 +3445,7 @@ const SmoothlyPicker = class {
3442
3445
  : []),
3443
3446
  ...((_c = this.options) !== null && _c !== void 0 ? _c : []),
3444
3447
  ];
3445
- return (index.h(index.Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, index.h("div", null, index.h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), index.h("label", { part: "label-element" }, this.label), index.h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
3448
+ return (index.h(index.Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, index.h("div", null, index.h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), index.h("label", { part: "label-element" }, this.label), index.h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
3446
3449
  ? this.selections.length.toString() + " " + this.selectionName
3447
3450
  : this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), index.h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), index.h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), index.h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
3448
3451
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
5
+ const index = require('./index-48630c3c.js');
6
6
  const getLanguage = require('./getLanguage-7991c46a.js');
7
7
 
8
8
  function from$K(country) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
5
+ const index = require('./index-48630c3c.js');
6
6
  const GoogleFont = require('./GoogleFont-6c4f0da1.js');
7
7
 
8
8
  const SmoothlyGoogleFont = class {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
5
+ const index = require('./index-48630c3c.js');
6
6
 
7
7
  const styleCss = "smoothly-radio-group{display:flex;position:relative;color:none !important;background:none !important;margin:0.5em 0}smoothly-radio-group[hidden]{display:none}smoothly-radio-group[orientation=vertical] *:not(:first-of-type)>input[type=radio]~label{border-top:none}smoothly-radio-group:not([orientation=vertical]) *:not(:first-of-type)>input[type=radio]~label{border-left:none}smoothly-radio-group[orientation=vertical]{flex-direction:column}smoothly-radio-group[orientation=vertical] :first-of-type>input[type=radio]~label{border-radius:4px 4px 0 0}smoothly-radio-group[orientation=vertical] :last-of-type>input[type=radio]~label{border-radius:0 0 4px 4px}smoothly-radio-group:not([orientation=vertical]){flex-direction:row}smoothly-radio-group:not([orientation=vertical]) :first-of-type>input[type=radio]~label{border-radius:4px 0 0 4px}smoothly-radio-group:not([orientation=vertical]) :last-of-type>input[type=radio]~label{border-radius:0 4px 4px 0}";
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
5
+ const index = require('./index-48630c3c.js');
6
6
 
7
7
  const styleCss = "smoothly-reorder>*{cursor:move;transition:transform 0.3s}smoothly-reorder>*.dragging{transition:none;box-shadow:0 0 10px rgba(var(--smoothly-dark-color));z-index:1;user-select:none}";
8
8
 
@@ -16,9 +16,9 @@ const SmoothlyReorder = class {
16
16
  if (this.childrenCache)
17
17
  result = this.childrenCache;
18
18
  else {
19
- for (let index = 0; index < this.element.children.length; index++) {
20
- const element = this.element.children[index];
21
- if (element instanceof HTMLElement) {
19
+ for (let index$1 = 0; index$1 < this.element.children.length; index$1++) {
20
+ const element = this.element.children[index$1];
21
+ if (element instanceof index.H) {
22
22
  const bounds = element.getBoundingClientRect();
23
23
  result.push({
24
24
  top: bounds.top,
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
6
- const Listenable = require('./Listenable-fcea5136.js');
5
+ const index = require('./index-48630c3c.js');
6
+ const Listenable = require('./Listenable-e157f34c.js');
7
7
  require('./GoogleFont-6c4f0da1.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
6
- const Listenable = require('./Listenable-fcea5136.js');
5
+ const index = require('./index-48630c3c.js');
6
+ const Listenable = require('./Listenable-e157f34c.js');
7
7
  require('./GoogleFont-6c4f0da1.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8352a4e0.js');
5
+ const index = require('./index-48630c3c.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -55,14 +55,22 @@ export class SmoothlyMenuOptions {
55
55
  this.keyword = keyword;
56
56
  const keywordLowercase = keyword.toLowerCase();
57
57
  this.filteredOptions = [];
58
- for (const option of this.options) {
59
- const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
60
- const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
61
- isVisible && this.filteredOptions.push(option);
58
+ if (keywordLowercase == "") {
59
+ this.showAllOptions();
60
+ }
61
+ else {
62
+ for (const option of this.options) {
63
+ const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
64
+ const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
65
+ isVisible && this.filteredOptions.push(option);
66
+ }
62
67
  }
63
68
  this.menuEmpty.emit(!this.filteredOptions.length);
64
69
  this.order && this.sortOptions(keyword);
65
70
  }
71
+ showAllOptions() {
72
+ this.filteredOptions = [...this.options];
73
+ }
66
74
  sortOptions(keyword) {
67
75
  const keywordLowercase = keyword.toLowerCase();
68
76
  this.filteredOptions.sort((a, b) => {
@@ -82,8 +82,6 @@ export class SmoothlyPicker {
82
82
  const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
83
83
  if (isNewSelection)
84
84
  this.selections = this.multiple ? [...this.selections, selection] : [selection];
85
- this.inputElement.value = "";
86
- this.filterOptions();
87
85
  this.keepFocusOnReRender = true;
88
86
  this.isOpen = this.multiple;
89
87
  }
@@ -127,7 +125,6 @@ export class SmoothlyPicker {
127
125
  else if (event.key == "Escape") {
128
126
  this.inputElement.value = "";
129
127
  this.isOpen = false;
130
- this.filterOptions();
131
128
  }
132
129
  else if (event.key == " " && this.inputElement.value == "") {
133
130
  event.preventDefault();
@@ -140,13 +137,11 @@ export class SmoothlyPicker {
140
137
  this.isOpen = !this.isOpen;
141
138
  this.inputElement.focus();
142
139
  this.highlightDefault();
143
- this.filterOptions();
144
140
  }
145
141
  }
146
142
  onBlur() {
147
143
  this.inputElement.value = "";
148
144
  this.isOpen = false;
149
- this.filterOptions();
150
145
  }
151
146
  render() {
152
147
  var _a, _b, _c;
@@ -173,7 +168,7 @@ export class SmoothlyPicker {
173
168
  : []),
174
169
  ...((_c = this.options) !== null && _c !== void 0 ? _c : []),
175
170
  ];
176
- return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
171
+ return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
177
172
  ? this.selections.length.toString() + " " + this.selectionName
178
173
  : this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
179
174
  }
@@ -1,3 +1,3 @@
1
1
  export { App, redirect } from "./components/App";
2
- export { ClientIdentifier, GoogleFont, Icon, Message, Notice, Trigger, Listenable, } from "./model";
2
+ export { ClientIdentifier, GoogleFont, Icon, Message, Notice, Trigger, StateBase, Listenable, } from "./model";
3
3
  export { Cosmetic } from "./utilities";
@@ -10,18 +10,19 @@ export class Listenable {
10
10
  constructor() {
11
11
  _Listenable_listeners.set(this, {});
12
12
  }
13
- listen(property, listener) {
13
+ listen(property, listener, options) {
14
14
  var _a, _b;
15
15
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
16
- listener(this[property]);
16
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
17
+ listener(this[property]);
17
18
  }
18
19
  unlisten(property, listener) {
19
20
  var _a, _b;
20
21
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
21
22
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
22
23
  }
23
- static load(backend, listenable) {
24
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
24
+ static load(backend) {
25
+ const result = backend.listenable;
25
26
  return Object.defineProperties(result, getProperties(backend));
26
27
  function getProperties(backend) {
27
28
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -45,7 +46,7 @@ export class Listenable {
45
46
  }
46
47
  : {
47
48
  get() {
48
- return backend[name].bind(backend);
49
+ return backend[name];
49
50
  },
50
51
  },
51
52
  ]));
@@ -0,0 +1,7 @@
1
+ import { Listenable } from "./Listenable";
2
+ export class StateBase {
3
+ constructor(...parameters) {
4
+ this.listenable = new Listenable();
5
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
6
+ }
7
+ }
@@ -5,3 +5,4 @@ export { Message } from "./Message";
5
5
  export { Notice } from "./Notice";
6
6
  export { Trigger } from "./Trigger";
7
7
  export { Listenable } from "./Listenable";
8
+ export { StateBase } from "./StateBase";
@@ -1309,18 +1309,19 @@ class Listenable {
1309
1309
  constructor() {
1310
1310
  _Listenable_listeners.set(this, {});
1311
1311
  }
1312
- listen(property, listener) {
1312
+ listen(property, listener, options) {
1313
1313
  var _a, _b;
1314
1314
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
1315
- listener(this[property]);
1315
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
1316
+ listener(this[property]);
1316
1317
  }
1317
1318
  unlisten(property, listener) {
1318
1319
  var _a, _b;
1319
1320
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
1320
1321
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
1321
1322
  }
1322
- static load(backend, listenable) {
1323
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
1323
+ static load(backend) {
1324
+ const result = backend.listenable;
1324
1325
  return Object.defineProperties(result, getProperties(backend));
1325
1326
  function getProperties(backend) {
1326
1327
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -1344,7 +1345,7 @@ class Listenable {
1344
1345
  }
1345
1346
  : {
1346
1347
  get() {
1347
- return backend[name].bind(backend);
1348
+ return backend[name];
1348
1349
  },
1349
1350
  },
1350
1351
  ]));
@@ -1353,6 +1354,13 @@ class Listenable {
1353
1354
  }
1354
1355
  _Listenable_listeners = new WeakMap();
1355
1356
 
1357
+ class StateBase {
1358
+ constructor(...parameters) {
1359
+ this.listenable = new Listenable();
1360
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
1361
+ }
1362
+ }
1363
+
1356
1364
  var Hex;
1357
1365
  (function (Hex) {
1358
1366
  function is(value) {
@@ -22814,14 +22822,22 @@ const SmoothlyMenuOptions$1 = class extends HTMLElement {
22814
22822
  this.keyword = keyword;
22815
22823
  const keywordLowercase = keyword.toLowerCase();
22816
22824
  this.filteredOptions = [];
22817
- for (const option of this.options) {
22818
- const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
22819
- const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
22820
- isVisible && this.filteredOptions.push(option);
22825
+ if (keywordLowercase == "") {
22826
+ this.showAllOptions();
22827
+ }
22828
+ else {
22829
+ for (const option of this.options) {
22830
+ const names = option.name + (option.aliases ? option.aliases.join(" ") : "");
22831
+ const isVisible = names.toLowerCase().includes(keywordLowercase) && !excludeValues.includes(option.value);
22832
+ isVisible && this.filteredOptions.push(option);
22833
+ }
22821
22834
  }
22822
22835
  this.menuEmpty.emit(!this.filteredOptions.length);
22823
22836
  this.order && this.sortOptions(keyword);
22824
22837
  }
22838
+ showAllOptions() {
22839
+ this.filteredOptions = [...this.options];
22840
+ }
22825
22841
  sortOptions(keyword) {
22826
22842
  const keywordLowercase = keyword.toLowerCase();
22827
22843
  this.filteredOptions.sort((a, b) => {
@@ -23089,8 +23105,6 @@ const SmoothlyPicker$1 = class extends HTMLElement {
23089
23105
  const isNewSelection = this.selections.reduce((acc, current) => acc && current.value != selection.value, true);
23090
23106
  if (isNewSelection)
23091
23107
  this.selections = this.multiple ? [...this.selections, selection] : [selection];
23092
- this.inputElement.value = "";
23093
- this.filterOptions();
23094
23108
  this.keepFocusOnReRender = true;
23095
23109
  this.isOpen = this.multiple;
23096
23110
  }
@@ -23134,7 +23148,6 @@ const SmoothlyPicker$1 = class extends HTMLElement {
23134
23148
  else if (event.key == "Escape") {
23135
23149
  this.inputElement.value = "";
23136
23150
  this.isOpen = false;
23137
- this.filterOptions();
23138
23151
  }
23139
23152
  else if (event.key == " " && this.inputElement.value == "") {
23140
23153
  event.preventDefault();
@@ -23147,13 +23160,11 @@ const SmoothlyPicker$1 = class extends HTMLElement {
23147
23160
  this.isOpen = !this.isOpen;
23148
23161
  this.inputElement.focus();
23149
23162
  this.highlightDefault();
23150
- this.filterOptions();
23151
23163
  }
23152
23164
  }
23153
23165
  onBlur() {
23154
23166
  this.inputElement.value = "";
23155
23167
  this.isOpen = false;
23156
- this.filterOptions();
23157
23168
  }
23158
23169
  render() {
23159
23170
  var _a, _b, _c;
@@ -23180,7 +23191,7 @@ const SmoothlyPicker$1 = class extends HTMLElement {
23180
23191
  : []),
23181
23192
  ...((_c = this.options) !== null && _c !== void 0 ? _c : []),
23182
23193
  ];
23183
- return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onFocus: () => this.highlightDefault(), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
23194
+ return (h(Host, { style: cssVariables, "has-selection": this.selections.length > 0, "is-open": this.isOpen ? "" : undefined, onMouseDown: (e) => e.preventDefault(), onClick: () => this.onClick() }, h("div", null, h("smoothly-icon", { part: "search", class: "search", name: "search-outline", size: "tiny" }), h("label", { part: "label-element" }, this.label), h("input", { part: "input", disabled: this.disabled, readonly: this.readonly, type: "text", ref: (el) => (this.inputElement = el ? el : this.inputElement), onBlur: () => this.onBlur(), placeholder: this.selections.length > 3
23184
23195
  ? this.selections.length.toString() + " " + this.selectionName
23185
23196
  : this.selections.map(selection => selection.name).join(", "), onKeyDown: e => this.onKeyDown(e), onInput: (e) => this.onInput(e) }), h("smoothly-icon", { part: "chevron", class: "down", name: "chevron-down", size: "tiny" }), h("smoothly-icon", { part: "chevron", class: "up", name: "chevron-up", size: "tiny" })), h("smoothly-menu-options", { part: "menu-options", style: { width: "100%" }, toggle: true, optionStyle: Object.assign({}, this.optionStyle), order: false, emptyMenuLabel: this.emptyMenuLabel, newOptionLabel: this.newOptionLabel, "max-menu-height": this.maxMenuHeight, mutable: this.mutable, ref: (el) => (this.menuElement = el !== null && el !== void 0 ? el : this.menuElement), onClick: e => e.stopPropagation(), resetHighlightOnOptionsChange: false, options: options })));
23186
23197
  }
@@ -24390,4 +24401,4 @@ const defineCustomElements = (opts) => {
24390
24401
  }
24391
24402
  };
24392
24403
 
24393
- export { App, ClientIdentifier, Cosmetic, GoogleFont, Icon, Listenable, Message, Notice, SmoothlyAccordion, SmoothlyAccordionItem, SmoothlyApp, SmoothlyAppDemo, SmoothlyBacktotop, SmoothlyButton, SmoothlyCalendar, SmoothlyCheckbox, SmoothlyCountry, SmoothlyDialog, SmoothlyDialogDemo, SmoothlyDisplay, SmoothlyDisplayAmount, SmoothlyDisplayDateTime, SmoothlyDisplayDemo, SmoothlyFrame, SmoothlyGoogleFont, SmoothlyIcon, SmoothlyIconDemo, SmoothlyInput, SmoothlyInputDate, SmoothlyInputDateRange, SmoothlyInputDemo, SmoothlyInputMonth, SmoothlyItem, SmoothlyMenuOptions, SmoothlyNotification, SmoothlyNotifier, SmoothlyOption, SmoothlyPicker, SmoothlyPopup, SmoothlyQuiet, SmoothlyRadio, SmoothlyRadioButton, SmoothlyRadioButtonItem, SmoothlyRadioGroup, SmoothlyReorder, SmoothlyRoom, SmoothlySelect, SmoothlySelectDemo, SmoothlySelector, SmoothlySkeleton, SmoothlySpinner, SmoothlySubmit, SmoothlySvg, SmoothlyTab, SmoothlyTabSwitch, SmoothlyTable, SmoothlyTableCell, SmoothlyTableDemo, SmoothlyTableExpandableCell, SmoothlyTableExpandableRow, SmoothlyTableHeader, SmoothlyTableRow, SmoothlyTrigger, SmoothlyTriggerSink, SmoothlyTriggerSource, SmoothlyTuple, SmoothlyUrlencoded, Trigger, defineCustomElements, redirect };
24404
+ export { App, ClientIdentifier, Cosmetic, GoogleFont, Icon, Listenable, Message, Notice, SmoothlyAccordion, SmoothlyAccordionItem, SmoothlyApp, SmoothlyAppDemo, SmoothlyBacktotop, SmoothlyButton, SmoothlyCalendar, SmoothlyCheckbox, SmoothlyCountry, SmoothlyDialog, SmoothlyDialogDemo, SmoothlyDisplay, SmoothlyDisplayAmount, SmoothlyDisplayDateTime, SmoothlyDisplayDemo, SmoothlyFrame, SmoothlyGoogleFont, SmoothlyIcon, SmoothlyIconDemo, SmoothlyInput, SmoothlyInputDate, SmoothlyInputDateRange, SmoothlyInputDemo, SmoothlyInputMonth, SmoothlyItem, SmoothlyMenuOptions, SmoothlyNotification, SmoothlyNotifier, SmoothlyOption, SmoothlyPicker, SmoothlyPopup, SmoothlyQuiet, SmoothlyRadio, SmoothlyRadioButton, SmoothlyRadioButtonItem, SmoothlyRadioGroup, SmoothlyReorder, SmoothlyRoom, SmoothlySelect, SmoothlySelectDemo, SmoothlySelector, SmoothlySkeleton, SmoothlySpinner, SmoothlySubmit, SmoothlySvg, SmoothlyTab, SmoothlyTabSwitch, SmoothlyTable, SmoothlyTableCell, SmoothlyTableDemo, SmoothlyTableExpandableCell, SmoothlyTableExpandableRow, SmoothlyTableHeader, SmoothlyTableRow, SmoothlyTrigger, SmoothlyTriggerSink, SmoothlyTriggerSource, SmoothlyTuple, SmoothlyUrlencoded, StateBase, Trigger, defineCustomElements, redirect };
@@ -782,18 +782,19 @@ class Listenable {
782
782
  constructor() {
783
783
  _Listenable_listeners.set(this, {});
784
784
  }
785
- listen(property, listener) {
785
+ listen(property, listener, options) {
786
786
  var _a, _b;
787
787
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
788
- listener(this[property]);
788
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
789
+ listener(this[property]);
789
790
  }
790
791
  unlisten(property, listener) {
791
792
  var _a, _b;
792
793
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
793
794
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
794
795
  }
795
- static load(backend, listenable) {
796
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
796
+ static load(backend) {
797
+ const result = backend.listenable;
797
798
  return Object.defineProperties(result, getProperties(backend));
798
799
  function getProperties(backend) {
799
800
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -817,7 +818,7 @@ class Listenable {
817
818
  }
818
819
  : {
819
820
  get() {
820
- return backend[name].bind(backend);
821
+ return backend[name];
821
822
  },
822
823
  },
823
824
  ]));
@@ -1,4 +1,4 @@
1
- import { g as getRenderingRef, f as forceUpdate, h } from './index-7b57a52c.js';
1
+ import { g as getRenderingRef, f as forceUpdate, h } from './index-e9e4cadb.js';
2
2
 
3
3
  const appendToMap = (map, propName, value) => {
4
4
  const items = map.get(propName);
@@ -2038,6 +2038,8 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2038
2038
  const styles = /*@__PURE__*/ new Map();
2039
2039
  const win = typeof window !== 'undefined' ? window : {};
2040
2040
  const doc = win.document || { head: {} };
2041
+ const H = (win.HTMLElement || class {
2042
+ });
2041
2043
  const plt = {
2042
2044
  $flags$: 0,
2043
2045
  $resourcesUrl$: '',
@@ -2100,4 +2102,4 @@ const flush = () => {
2100
2102
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
2101
2103
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2102
2104
 
2103
- export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getRenderingRef as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2105
+ export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, H as d, forceUpdate as f, getRenderingRef as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { A as App, C as Cosmetic, N as Notice, r as redirect } from './index-990cc22d.js';
2
- import { I as Identifier } from './Listenable-10f48463.js';
3
- export { a as Icon, L as Listenable, M as Message, T as Trigger } from './Listenable-10f48463.js';
1
+ export { A as App, C as Cosmetic, N as Notice, r as redirect } from './index-62de77e7.js';
2
+ import { I as Identifier, L as Listenable } from './Listenable-afd6cd7e.js';
3
+ export { a as Icon, L as Listenable, M as Message, T as Trigger } from './Listenable-afd6cd7e.js';
4
4
  export { G as GoogleFont } from './GoogleFont-8474516b.js';
5
- import './index-7b57a52c.js';
5
+ import './index-e9e4cadb.js';
6
6
 
7
7
  class ClientIdentifier {
8
8
  constructor() { }
@@ -16,4 +16,11 @@ class ClientIdentifier {
16
16
  }
17
17
  }
18
18
 
19
- export { ClientIdentifier };
19
+ class StateBase {
20
+ constructor(...parameters) {
21
+ this.listenable = new Listenable();
22
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
23
+ }
24
+ }
25
+
26
+ export { ClientIdentifier, StateBase };
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-7b57a52c.js';
2
- export { s as setNonce } from './index-7b57a52c.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-e9e4cadb.js';
2
+ export { s as setNonce } from './index-e9e4cadb.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com