@leavittsoftware/web 9.7.0 → 9.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/titanium/site-search-text-field-controller/site-search-text-field-controller.d.ts +6 -0
- package/titanium/site-search-text-field-controller/site-search-text-field-controller.js +16 -0
- package/titanium/site-search-text-field-controller/site-search-text-field-controller.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leavittsoftware/web",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"files": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"url": "https://github.com/LeavittSoftware/titanium-elements/issues"
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/LeavittSoftware/titanium-elements/#readme",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "0e32bd84f07c29bddc762ec906b391abfbf66bd9"
|
|
48
48
|
}
|
|
@@ -30,15 +30,21 @@ export declare class TitaniumSiteSearchTextFieldController implements ReactiveCo
|
|
|
30
30
|
#private;
|
|
31
31
|
/** Current value of the search text field. Read this in your data-fetching method to apply the search filter. */
|
|
32
32
|
searchTerm: string;
|
|
33
|
+
/** When `true`, the shared text field is disabled. Each page's controller has its own value (default `false`);
|
|
34
|
+
* the active page's value wins because `#activate()` syncs it to the text field on every page transition. */
|
|
35
|
+
get disabled(): boolean;
|
|
36
|
+
set disabled(value: boolean);
|
|
33
37
|
/**
|
|
34
38
|
* @param host - The page element that owns this controller. Must satisfy {@link PageElement}.
|
|
35
39
|
* @param context - The Lit context key used to consume the shared search text field instance.
|
|
36
40
|
* @param options.placeholder - Placeholder text shown in the shared search text field when this page is active.
|
|
37
41
|
* @param options.onSearch - Called when the user types. Handle page resets and data reloads here.
|
|
38
42
|
* @param options.debounceDelay - Debounce interval in ms. Omit to use the default delay. Set to `0` to fire `onSearch` immediately on every keystroke.
|
|
43
|
+
* @param options.disabled - Initial disabled state. Defaults to `false`.
|
|
39
44
|
*/
|
|
40
45
|
constructor(host: SiteSearchHost, context: TitaniumTextFieldSearchContext, options: {
|
|
41
46
|
debounceDelay?: number;
|
|
47
|
+
disabled?: boolean;
|
|
42
48
|
placeholder: string;
|
|
43
49
|
onSearch: () => Promise<void>;
|
|
44
50
|
});
|
|
@@ -25,17 +25,31 @@ export class TitaniumSiteSearchTextFieldController {
|
|
|
25
25
|
#placeholder;
|
|
26
26
|
#wasActive;
|
|
27
27
|
#listenerCleanup;
|
|
28
|
+
#disabled;
|
|
29
|
+
/** When `true`, the shared text field is disabled. Each page's controller has its own value (default `false`);
|
|
30
|
+
* the active page's value wins because `#activate()` syncs it to the text field on every page transition. */
|
|
31
|
+
get disabled() {
|
|
32
|
+
return this.#disabled;
|
|
33
|
+
}
|
|
34
|
+
set disabled(value) {
|
|
35
|
+
this.#disabled = value;
|
|
36
|
+
if (this.#textField) {
|
|
37
|
+
this.#textField.disabled = value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
28
40
|
/**
|
|
29
41
|
* @param host - The page element that owns this controller. Must satisfy {@link PageElement}.
|
|
30
42
|
* @param context - The Lit context key used to consume the shared search text field instance.
|
|
31
43
|
* @param options.placeholder - Placeholder text shown in the shared search text field when this page is active.
|
|
32
44
|
* @param options.onSearch - Called when the user types. Handle page resets and data reloads here.
|
|
33
45
|
* @param options.debounceDelay - Debounce interval in ms. Omit to use the default delay. Set to `0` to fire `onSearch` immediately on every keystroke.
|
|
46
|
+
* @param options.disabled - Initial disabled state. Defaults to `false`.
|
|
34
47
|
*/
|
|
35
48
|
constructor(host, context, options) {
|
|
36
49
|
this.#textField = null;
|
|
37
50
|
this.#wasActive = false;
|
|
38
51
|
this.#listenerCleanup = null;
|
|
52
|
+
this.#disabled = false;
|
|
39
53
|
/** Current value of the search text field. Read this in your data-fetching method to apply the search filter. */
|
|
40
54
|
this.searchTerm = '';
|
|
41
55
|
this.#handleInput = () => {
|
|
@@ -45,6 +59,7 @@ export class TitaniumSiteSearchTextFieldController {
|
|
|
45
59
|
};
|
|
46
60
|
this.#host = host;
|
|
47
61
|
this.#placeholder = options.placeholder;
|
|
62
|
+
this.#disabled = options.disabled ?? false;
|
|
48
63
|
if (options.debounceDelay !== 0) {
|
|
49
64
|
const debouncer = new Debouncer(() => {
|
|
50
65
|
if (!this.#host.isActive)
|
|
@@ -80,6 +95,7 @@ export class TitaniumSiteSearchTextFieldController {
|
|
|
80
95
|
this.#textField.addEventListener('input', this.#handleInput, { signal: this.#listenerCleanup.signal });
|
|
81
96
|
this.#textField.value = this.searchTerm;
|
|
82
97
|
this.#textField.placeholder = this.#placeholder;
|
|
98
|
+
this.#textField.disabled = this.#disabled;
|
|
83
99
|
}
|
|
84
100
|
#detachListener() {
|
|
85
101
|
this.#listenerCleanup?.abort();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-search-text-field-controller.js","sourceRoot":"","sources":["site-search-text-field-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,eAAe,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAU5E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,qCAAqC;IAChD,KAAK,CAAiB;IACtB,eAAe,CAAa;IAC5B,UAAU,CAAwD;IAClE,YAAY,CAAS;IACrB,UAAU,CAAS;IACnB,gBAAgB,CAAgC;
|
|
1
|
+
{"version":3,"file":"site-search-text-field-controller.js","sourceRoot":"","sources":["site-search-text-field-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,eAAe,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAU5E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,qCAAqC;IAChD,KAAK,CAAiB;IAC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