@smart-webcomponents-angular/passwordtextbox 19.0.8 → 25.5.5
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/esm2020/passwordtextbox/smart.element.mjs +16 -3
- package/esm2020/passwordtextbox/smart.passwordtextbox.mjs +46 -35
- package/fesm2015/smart-webcomponents-angular-passwordtextbox.mjs +59 -36
- package/fesm2015/smart-webcomponents-angular-passwordtextbox.mjs.map +1 -1
- package/fesm2020/smart-webcomponents-angular-passwordtextbox.mjs +59 -36
- package/fesm2020/smart-webcomponents-angular-passwordtextbox.mjs.map +1 -1
- package/index.d.ts +6083 -5194
- package/package.json +20 -17
- package/passwordtextbox/smart.element.d.ts +6 -2
- package/passwordtextbox/smart.passwordtextbox.d.ts +35 -32
- package/source/modules/smart.passwordtextbox.js +2 -2
- package/source/smart.button.js +3 -3
- package/source/smart.element.js +3 -3
- package/source/smart.input.js +3 -3
- package/source/smart.passwordtextbox.js +3 -3
- package/source/smart.tooltip.js +2 -2
- package/styles/font/smart-icons.eot +0 -0
- package/styles/font/smart-icons.svg +14 -0
- package/styles/font/smart-icons.ttf +0 -0
- package/styles/font/smart-icons.woff +0 -0
- package/styles/font/smart-icons.woff2 +0 -0
- package/styles/smart.base.css +2 -2
- package/styles/smart.common.css +1 -1
- package/styles/smart.passwordtextbox.css +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-webcomponents-angular/passwordtextbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.5.5",
|
|
4
4
|
"preferGlobal": true,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"angular 15 passwordtextbox",
|
|
11
11
|
"angular 16 passwordtextbox",
|
|
12
12
|
"angular 17 passwordtextbox",
|
|
13
|
+
"angular 18 passwordtextbox",
|
|
14
|
+
"angular 19 passwordtextbox",
|
|
15
|
+
"angular 20 passwordtextbox",
|
|
13
16
|
"passwordtextbox",
|
|
14
17
|
"angular passwordtextbox component",
|
|
15
18
|
"passwordtextbox for angular",
|
|
@@ -20,27 +23,27 @@
|
|
|
20
23
|
"angular material ui passwordtextbox component"
|
|
21
24
|
],
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"tslib": "^2.
|
|
26
|
+
"tslib": "^2.5.0"
|
|
24
27
|
},
|
|
25
28
|
"devDependencies": {
|
|
26
|
-
"@angular/animations": "
|
|
27
|
-
"@angular/common": "
|
|
28
|
-
"@angular/compiler": "
|
|
29
|
-
"@angular/core": "
|
|
30
|
-
"@angular/forms": "
|
|
29
|
+
"@angular/animations": "16 - 19",
|
|
30
|
+
"@angular/common": "16 - 19",
|
|
31
|
+
"@angular/compiler": "16 - 19",
|
|
32
|
+
"@angular/core": "16 - 19",
|
|
33
|
+
"@angular/forms": "16 - 19",
|
|
31
34
|
"@angular/platform-browser": "12 - 16",
|
|
32
35
|
"core-js": "^2.6.9",
|
|
33
|
-
"rxjs": "^
|
|
36
|
+
"rxjs": "^7.8.1",
|
|
34
37
|
"systemjs": "0.19.43",
|
|
35
|
-
"zone.js": "~0.
|
|
36
|
-
"@angular-devkit/core": "
|
|
37
|
-
"@angular-devkit/schematics": "
|
|
38
|
-
"@angular/bazel": "
|
|
39
|
-
"@angular/compiler-cli": "
|
|
40
|
-
"@angular/platform-browser-dynamic": "
|
|
41
|
-
"@angular/platform-server": "
|
|
42
|
-
"@angular/router": "
|
|
43
|
-
"typescript": "~
|
|
38
|
+
"zone.js": "~0.15.0",
|
|
39
|
+
"@angular-devkit/core": "16 - 19",
|
|
40
|
+
"@angular-devkit/schematics": "16 - 19",
|
|
41
|
+
"@angular/bazel": "16 - 19",
|
|
42
|
+
"@angular/compiler-cli": "16 - 19",
|
|
43
|
+
"@angular/platform-browser-dynamic": "16 - 19",
|
|
44
|
+
"@angular/platform-server": "16 - 19",
|
|
45
|
+
"@angular/router": "16 - 19",
|
|
46
|
+
"typescript": "~5.5.0"
|
|
44
47
|
},
|
|
45
48
|
"author": "jQWidgets <support@jqwidgets.com> (https://www.htmlelements.com/)",
|
|
46
49
|
"license": "SEE LICENSE IN https://www.htmlelements.com/license/",
|
|
@@ -18,6 +18,9 @@ export declare class BaseElement {
|
|
|
18
18
|
blur(): void;
|
|
19
19
|
click(): void;
|
|
20
20
|
focus(options?: FocusOptions): void;
|
|
21
|
+
/** @description Sets or gets the license. */
|
|
22
|
+
get license(): string;
|
|
23
|
+
set license(value: string);
|
|
21
24
|
/** @description Sets or gets the language. Used in conjunction with the property messages. */
|
|
22
25
|
get locale(): string;
|
|
23
26
|
set locale(value: string);
|
|
@@ -34,6 +37,7 @@ export declare class BaseElement {
|
|
|
34
37
|
get theme(): string;
|
|
35
38
|
set theme(value: string);
|
|
36
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseElement, never>;
|
|
37
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseElement, never, never, { "locale": "locale"; "localizeFormatFunction": "localizeFormatFunction"; "messages": "messages"; "rightToLeft": "rightToLeft"; "theme": "theme"; }, { "onCreate": "onCreate"; "onReady": "onReady"; "onAttach": "onAttach"; "onDetach": "onDetach"; }, never>;
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseElement, never, never, { "license": "license"; "locale": "locale"; "localizeFormatFunction": "localizeFormatFunction"; "messages": "messages"; "rightToLeft": "rightToLeft"; "theme": "theme"; }, { "onCreate": "onCreate"; "onReady": "onReady"; "onAttach": "onAttach"; "onDetach": "onDetach"; }, never>;
|
|
38
41
|
}
|
|
39
|
-
|
|
42
|
+
declare let Smart: any;
|
|
43
|
+
export { Smart };
|
|
@@ -25,103 +25,106 @@ export declare class PasswordTextBoxComponent extends BaseElement implements OnI
|
|
|
25
25
|
* The registered callback function called when a blur event occurs on the form elements.
|
|
26
26
|
*/
|
|
27
27
|
_onTouched: () => any;
|
|
28
|
-
/** @description
|
|
28
|
+
/** @description Specifies or retrieves the current animation mode. When set to 'none', all animations are disabled. If set to any other supported value, animations will be enabled according to the specified mode. */
|
|
29
29
|
get animation(): Animation | string;
|
|
30
30
|
set animation(value: Animation | string);
|
|
31
|
-
/** @description
|
|
31
|
+
/** @description Indicates that the element will automatically receive keyboard focus as soon as the page is loaded, allowing users to interact with it immediately without clicking or tabbing to it. This is often used to improve accessibility and streamline user interaction with form fields or interactive elements. */
|
|
32
32
|
get autoFocus(): boolean;
|
|
33
33
|
set autoFocus(value: boolean);
|
|
34
|
-
/** @description
|
|
34
|
+
/** @description Determines whether the element is interactive or inactive. When enabled, users can interact with the element; when disabled, the element becomes unresponsive to user actions such as clicks or input. */
|
|
35
35
|
get disabled(): boolean;
|
|
36
36
|
set disabled(value: boolean);
|
|
37
|
-
/** @description
|
|
37
|
+
/** @description Defines the action that occurs when the "Enter" key is pressed within the input field. By default, the mode is set to "submit", meaning pressing "Enter" will attempt to submit the associated form. You can customize this behavior by specifying alternative modes, such as preventing form submission or triggering a custom handler. */
|
|
38
38
|
get enterKeyBehavior(): EnterKeyBehavior | string;
|
|
39
39
|
set enterKeyBehavior(value: EnterKeyBehavior | string);
|
|
40
|
-
/** @description
|
|
40
|
+
/** @description Specifies the form element with which this element is associated (referred to as its "form owner"). The value of this attribute should be the id of a element within the same HTML document. This allows the element to be associated with a form even if it is not nested inside the tags. */
|
|
41
41
|
get form(): string;
|
|
42
42
|
set form(value: string);
|
|
43
|
-
/** @description
|
|
43
|
+
/** @description Displays supplemental helper text beneath the element, visible only while the element is focused. This text provides additional guidance or context to users during interaction. */
|
|
44
44
|
get hint(): any;
|
|
45
45
|
set hint(value: any);
|
|
46
|
-
/** @description
|
|
46
|
+
/** @description Displays a label positioned above the input element. This label remains persistently visible, providing a clear and accessible description of the input’s purpose at all times. */
|
|
47
47
|
get label(): string;
|
|
48
48
|
set label(value: string);
|
|
49
|
-
/** @description
|
|
49
|
+
/** @description Gets or sets the unlockKey, a unique key required to activate and access the product. Use this property to retrieve the current unlock key or assign a new one to enable product unlocking functionality. */
|
|
50
|
+
get unlockKey(): string;
|
|
51
|
+
set unlockKey(value: string);
|
|
52
|
+
/** @description Specifies or retrieves the current language setting. This property determines which set of localized text strings from the messages property is used for display. When you set the language, the corresponding messages are shown to users in that language. When you get the language, it returns the currently active language code. */
|
|
50
53
|
get locale(): string;
|
|
51
54
|
set locale(value: string);
|
|
52
|
-
/** @description Callback
|
|
55
|
+
/** @description Callback function that allows you to customize the formatting of messages returned by the Localization Module. This enables you to modify or enhance localized message strings—such as adding dynamic data, adjusting placeholders, or changing text structure—before they are displayed to users. */
|
|
53
56
|
get localizeFormatFunction(): any;
|
|
54
57
|
set localizeFormatFunction(value: any);
|
|
55
|
-
/** @description
|
|
58
|
+
/** @description Specifies or retrieves the maximum number of characters allowed in the input field. If set, the user cannot enter more characters than this limit. This constraint helps enforce data validation and control the input length. */
|
|
56
59
|
get maxLength(): number;
|
|
57
60
|
set maxLength(value: number);
|
|
58
|
-
/** @description
|
|
61
|
+
/** @description Defines an object where each property corresponds to a specific password strength state, with associated string values that describe or label each state (e.g., "weak," "moderate," "strong"). This object is typically used to display feedback messages or labels reflecting the current strength of a user's password during input. */
|
|
59
62
|
get messages(): any;
|
|
60
63
|
set messages(value: any);
|
|
61
|
-
/** @description
|
|
64
|
+
/** @description Specifies or retrieves the minimum number of characters required for user input. When set, the user must enter at least this many characters for the input to be considered valid. */
|
|
62
65
|
get minLength(): number;
|
|
63
66
|
set minLength(value: number);
|
|
64
|
-
/** @description Sets or
|
|
67
|
+
/** @description Sets or retrieves the value of the element's name attribute. The name attribute is used to identify form fields when submitting HTML forms, allowing the data entered in the element to be included in the form's submission with the specified name as the key. This is essential for server-side processing of form data. */
|
|
65
68
|
get name(): string;
|
|
66
69
|
set name(value: string);
|
|
67
|
-
/** @description With this property
|
|
70
|
+
/** @description With this property, you can specify a custom callback function that evaluates the strength of a password. The function should accept the current password as input and return a string representing the assessed strength level. The returned string must be one of the following predefined values: 'short', 'weak', 'far', 'good', or 'strong'. This value will be used by the component to indicate how secure the entered password is according to your custom logic. */
|
|
68
71
|
get passwordStrength(): any;
|
|
69
72
|
set passwordStrength(value: any);
|
|
70
|
-
/** @description
|
|
73
|
+
/** @description This is the text that appears within the element when it is empty, serving as a prompt or hint to the user about the expected input. Once the user enters a value, this placeholder text disappears. */
|
|
71
74
|
get placeholder(): string;
|
|
72
75
|
set placeholder(value: string);
|
|
73
|
-
/** @description
|
|
76
|
+
/** @description Enhances the requirement that the user must provide a value for this element before the form can be submitted. If this field is left empty, the form submission will be blocked and the user will be prompted to enter a value. This ensures that the input is mandatory, helping maintain data completeness and integrity. */
|
|
74
77
|
get required(): boolean;
|
|
75
78
|
set required(value: boolean);
|
|
76
|
-
/** @description Sets or
|
|
79
|
+
/** @description Sets or retrieves a value specifying whether the element’s alignment is adjusted to support right-to-left (RTL) languages, such as Arabic or Hebrew. When enabled, the element’s content and layout are adapted for proper display in locales that use right-to-left text direction. */
|
|
77
80
|
get rightToLeft(): boolean;
|
|
78
81
|
set rightToLeft(value: boolean);
|
|
79
|
-
/** @description
|
|
82
|
+
/** @description Determines if the entire content of the input field should be automatically highlighted (selected) when the input receives focus, making it easier for users to quickly replace or copy the content. */
|
|
80
83
|
get selectAllOnFocus(): boolean;
|
|
81
84
|
set selectAllOnFocus(value: boolean);
|
|
82
|
-
/** @description
|
|
85
|
+
/** @description Specifies whether the password icon (such as an eye symbol to show or hide password text) is displayed in the input field. */
|
|
83
86
|
get showPasswordIcon(): boolean;
|
|
84
87
|
set showPasswordIcon(value: boolean);
|
|
85
|
-
/** @description
|
|
88
|
+
/** @description Specifies whether a tooltip displaying the password strength indicator will be visible to the user during password entry. When enabled, this tooltip provides real-time feedback on the strength of the entered password. */
|
|
86
89
|
get showPasswordStrength(): boolean;
|
|
87
90
|
set showPasswordStrength(value: boolean);
|
|
88
|
-
/** @description
|
|
91
|
+
/** @description Specifies the visual theme to be applied. The theme controls the overall appearance and style—including colors, fonts, and backgrounds—of the element for a consistent look and feel. */
|
|
89
92
|
get theme(): string;
|
|
90
93
|
set theme(value: string);
|
|
91
|
-
/** @description
|
|
94
|
+
/** @description Specifies whether the Tooltip component should display an arrow pointing to the target element. Setting this option to true will show the arrow, while false will hide it. */
|
|
92
95
|
get tooltipArrow(): boolean;
|
|
93
96
|
set tooltipArrow(value: boolean);
|
|
94
|
-
/** @description
|
|
97
|
+
/** @description Specifies the amount of time, in milliseconds, to wait before displaying the tooltip after a user interaction (such as hovering or focusing on an element). */
|
|
95
98
|
get tooltipDelay(): number;
|
|
96
99
|
set tooltipDelay(value: number);
|
|
97
|
-
/** @description
|
|
100
|
+
/** @description Specifies the placement of the tooltip relative to the target element, such as "top", "bottom", "left", or "right". This controls where the tooltip will appear when it is displayed. */
|
|
98
101
|
get tooltipPosition(): PasswordTextBoxTooltipPosition | string;
|
|
99
102
|
set tooltipPosition(value: PasswordTextBoxTooltipPosition | string);
|
|
100
|
-
/** @description
|
|
103
|
+
/** @description Specifies a custom template for rendering the tooltip’s content, allowing you to define the layout, formatting, and dynamic data within the tooltip. This enables greater control over the appearance and behavior of the tooltip beyond the default content. */
|
|
101
104
|
get tooltipTemplate(): string;
|
|
102
105
|
set tooltipTemplate(value: string);
|
|
103
|
-
/** @description If true, the element
|
|
106
|
+
/** @description Indicates whether the element should be excluded from keyboard navigation and cannot receive focus. If set to true, users will not be able to focus on the element using the keyboard or mouse interactions. */
|
|
104
107
|
get unfocusable(): boolean;
|
|
105
108
|
set unfocusable(value: boolean);
|
|
106
|
-
/** @description Sets
|
|
109
|
+
/** @description Sets a new value for the element or retrieves its current value, depending on whether an argument is provided. Useful for updating or accessing the element’s data within a form or component. */
|
|
107
110
|
get value(): string;
|
|
108
111
|
set value(value: string);
|
|
109
|
-
/** @description This event is triggered
|
|
112
|
+
/** @description This event is triggered whenever the value of the element is modified by the user or through programmatic changes. It occurs after the change has been committed, allowing you to respond to updates in the element’s value.
|
|
110
113
|
* @param event. The custom event. Custom event was created with: event.detail( oldValue, value)
|
|
111
114
|
* oldValue - The previous value of the element before it was changed.
|
|
112
115
|
* value - The new value of the element.
|
|
113
116
|
*/
|
|
114
117
|
onChange: EventEmitter<CustomEvent>;
|
|
115
|
-
/** @description This event is triggered
|
|
118
|
+
/** @description This event is triggered whenever a key is released (key up) within the TextBox, but only if the TextBox's value has changed as a result of the key press. This ensures that the event fires solely when user input modifies the content, preventing unnecessary triggers when the value remains unchanged.
|
|
116
119
|
* @param event. The custom event. Custom event was created with: event.detail( oldValue, value)
|
|
117
120
|
* oldValue - The previous value before it was changed.
|
|
118
121
|
* value - The new value.
|
|
119
122
|
*/
|
|
120
123
|
onChanging: EventEmitter<CustomEvent>;
|
|
121
|
-
/** @description
|
|
124
|
+
/** @description Sets keyboard focus to the specified element, making it the active element on the page and enabling user input or interaction through the keyboard. This is commonly used to improve accessibility, guide user workflow, or trigger specific UI behaviors.
|
|
122
125
|
*/
|
|
123
126
|
focus(): void;
|
|
124
|
-
/** @description
|
|
127
|
+
/** @description This method resets the input field to its initial value, discarding any changes made by the user and restoring the input's original state as specified when the component or element was first rendered.
|
|
125
128
|
*/
|
|
126
129
|
reset(): void;
|
|
127
130
|
get isRendered(): boolean;
|
|
@@ -140,5 +143,5 @@ export declare class PasswordTextBoxComponent extends BaseElement implements OnI
|
|
|
140
143
|
/** @description Remove event listeners. */
|
|
141
144
|
private unlisten;
|
|
142
145
|
static ɵfac: i0.ɵɵFactoryDeclaration<PasswordTextBoxComponent, never>;
|
|
143
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordTextBoxComponent, "smart-password-text-box, [smart-password-text-box]", ["smart-password-text-box"], { "animation": "animation"; "autoFocus": "autoFocus"; "disabled": "disabled"; "enterKeyBehavior": "enterKeyBehavior"; "form": "form"; "hint": "hint"; "label": "label"; "locale": "locale"; "localizeFormatFunction": "localizeFormatFunction"; "maxLength": "maxLength"; "messages": "messages"; "minLength": "minLength"; "name": "name"; "passwordStrength": "passwordStrength"; "placeholder": "placeholder"; "required": "required"; "rightToLeft": "rightToLeft"; "selectAllOnFocus": "selectAllOnFocus"; "showPasswordIcon": "showPasswordIcon"; "showPasswordStrength": "showPasswordStrength"; "theme": "theme"; "tooltipArrow": "tooltipArrow"; "tooltipDelay": "tooltipDelay"; "tooltipPosition": "tooltipPosition"; "tooltipTemplate": "tooltipTemplate"; "unfocusable": "unfocusable"; "value": "value"; }, { "onChange": "onChange"; "onChanging": "onChanging"; }, never>;
|
|
146
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordTextBoxComponent, "smart-password-text-box, [smart-password-text-box]", ["smart-password-text-box"], { "animation": "animation"; "autoFocus": "autoFocus"; "disabled": "disabled"; "enterKeyBehavior": "enterKeyBehavior"; "form": "form"; "hint": "hint"; "label": "label"; "unlockKey": "unlockKey"; "locale": "locale"; "localizeFormatFunction": "localizeFormatFunction"; "maxLength": "maxLength"; "messages": "messages"; "minLength": "minLength"; "name": "name"; "passwordStrength": "passwordStrength"; "placeholder": "placeholder"; "required": "required"; "rightToLeft": "rightToLeft"; "selectAllOnFocus": "selectAllOnFocus"; "showPasswordIcon": "showPasswordIcon"; "showPasswordStrength": "showPasswordStrength"; "theme": "theme"; "tooltipArrow": "tooltipArrow"; "tooltipDelay": "tooltipDelay"; "tooltipPosition": "tooltipPosition"; "tooltipTemplate": "tooltipTemplate"; "unfocusable": "unfocusable"; "value": "value"; }, { "onChange": "onChange"; "onChanging": "onChanging"; }, never>;
|
|
144
147
|
}
|
package/source/smart.button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI
|
|
3
|
-
Copyright (c) 2011-
|
|
2
|
+
/* Smart UI v25.5.5 (2026-02-24)
|
|
3
|
+
Copyright (c) 2011-2024 jQWidgets.
|
|
4
4
|
License: https://htmlelements.com/license/ */ //
|
|
5
5
|
|
|
6
|
-
Smart("smart-button",class extends Smart.ContentElement{static get properties(){return{value:{type:"string"},name:{type:"string"},type:{value:"button",type:"string"},clickMode:{allowedValues:["hover","press","release","pressAndRelease"],type:"string",value:"release"}}}static get styleUrls(){return["smart.button.css"]}template(){return"<button class=\"smart-button smart-unselectable\" inner-h-t-m-l='[[innerHTML]]' id='button' type='[[type]]' name='[[name]]' value='[[value]]' disabled='[[disabled]]' role=\"presentation\"></button>"}refresh(){}static get listeners(){return{"button.down":"_downHandler","button.mouseenter":"_mouseEnterHandler","button.mouseleave":"_mouseLeaveHandler","button.touchend":"_touchEndHandler","button.click":"_clickHandler","button.up":"_upHandler",up:"_upHandler","button.focus":"_focusHandler","button.blur":"_blurHandler"}}focus(){const e=this;e.$.button?e.$.button.focus():HTMLElement.prototype.focus.call(e)}blur(){const e=this;e.$.button?e.$.button.blur():HTMLElement.prototype.blur.call(e)}_upHandler(e){const t=this;if(e.stopPropagation(),t.$.setAttributeValue("active",!1),t.dataset.target){const n=document.querySelector(t.dataset.target);let a=t.dataset.toggle;const r="smart-window".toLowerCase();if(n&&n.nodeName.toLowerCase()===r&&"modal"===a&&(a="openModal"),"tab"===a||"pill"===a||"list"===a){const e=this.closest(".nav, .list-group"),a='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',r=!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?e.children(".active"):e.querySelectorAll("li > .active");if(e){const n=e.querySelectorAll(a);for(let e=0;e<n.length;e++)n[e].classList.remove("primary");for(let e=0;e<r.length;e++)r[e].classList.remove("active");let i=t.parentNode;for(;i;){if("LI"===i.nodeName){i.classList.add("active");break}i=i.parentNode}t.classList.add("primary")}return n.parentNode.querySelectorAll(".active").forEach((e=>{e.classList.remove("active"),e.classList.add("smart-hidden")})),n.classList.add("active"),void n.classList.remove("smart-hidden")}a&&n&&!n[a]&&"collapse"===a&&(setTimeout((()=>{n.classList.contains("smart-hidden")?n.classList.remove("smart-hidden"):n.classList.add("smart-hidden")})),e.originalEvent.preventDefault()),a&&n&&!n[a]&&"dropdown"===a?(setTimeout((()=>{n.opened=!n.opened})),e.originalEvent.preventDefault()):a&&n&&n[a]&&(setTimeout((()=>{n[a]()}),50),e.originalEvent.preventDefault())}}_focusHandler(){this.$.setAttributeValue("focus",!0),this.$.fireEvent("focus")}_blurHandler(){this.$.setAttributeValue("focus",!1),this.$.fireEvent("blur")}_clickHandler(e){const t=this;("release"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly)&&(e.preventDefault(),e.stopPropagation())}_downHandler(e){const t=this;if(!(t.disabled||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t.$.setAttributeValue("active",!0),"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly))){if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_mouseEnterHandler(e){const t=this;if(!t.readonly&&(t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0),"hover"===t.clickMode)){const n="buttons"in e?e.buttons:e.which;if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_touchEndHandler(){const e=this;setTimeout((function(){e.$button.setAttributeValue("hover",!1),e.$.setAttributeValue("hover",!1)}),300)}_mouseLeaveHandler(){this.$button.setAttributeValue("hover",!1),this.$.setAttributeValue("hover",!1)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;"disabled"===e?(a._setFocusable(),a.$button&&a.$button.setAttributeValue("hover",!1),a.$.setAttributeValue("hover",!1),a instanceof Smart.RepeatButton&&a._stopRepeat()):"unfocusable"===e&&a._setFocusable()}_setFocusable(){const e=this,t=e.$.button?e.$.button:e;if(e.disabled||e.unfocusable)return t.removeAttribute("tabindex"),void(t.tabIndex=-1);t.tabIndex=e.tabIndex>0?e.tabIndex:0}ready(){const e=this;super.ready(),e.setAttribute("role","button"),e._setFocusable(),e.enableShadowDOM&&e.$.hiddenInput&&e.appendChild(e.$.hiddenInput)}}),Smart("smart-repeat-button",class extends Smart.Button{static get properties(){return{delay:{value:50,type:"number"},initialDelay:{value:150,type:"number"}}}static get listeners(){return{"button.down":"_startRepeat","button.mouseenter":"_overriddenHandler","button.mouseleave":"_overriddenHandler","button.pointerenter":"_updateInBoundsFlag","button.pointerleave":"_updateInBoundsFlag","button.touchmove":"_touchmoveHandler","document.up":"_stopRepeat"}}_clickHandler(e){const t=this;("release"!==t.clickMode||t.preventDefaultClick||t.readonly||t.disabled)&&(e.preventDefault(),e.stopPropagation(),t.preventDefaultClick=!1)}_updateInBoundsFlag(e){const t=this;-1!==e.type.indexOf("leave")?(t._isPointerInBounds=!1,t.$button.setAttributeValue("hover",!1),t.$.setAttributeValue("hover",!1)):(t._isPointerInBounds=!0,t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0)),1!==("buttons"in e?e.buttons:e.which)&&t._stopRepeat(e)}_startRepeat(e){const t=this;t.setAttribute("active",""),t._initialTimer||t.readonly||(t._initialTimer=setTimeout((function(){t._repeatTimer=setInterval((()=>{if(t._isPointerInBounds){if(t.hasAttribute("smart-blazor"))return t.$.dispatchEvent(new Event("click")),void(t.preventDefaultClick=!0);const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),t.preventDefaultClick=!0}}),t.delay)}),t.initialDelay))}_stopRepeat(e){const t=this;t.readonly||e&&("pointercancel"===e.type||e.originalEvent&&"pointercancel"===e.originalEvent.type)||(t.$.setAttributeValue("active",!1),t._repeatTimer&&(clearInterval(t._repeatTimer),t._repeatTimer=null),t._initialTimer&&(clearTimeout(t._initialTimer),t._initialTimer=null))}_touchmoveHandler(e){this.preventDefaultClick&&e.cancelable&&(e.preventDefault(),e.stopPropagation())}_overriddenHandler(){}}),Smart("smart-toggle-button",class extends Smart.Button{static get properties(){return{checked:{value:!1,type:"boolean?"},falseContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminate:{value:!1,type:"boolean"},trueContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateTemplate:{value:null,type:"any"},trueTemplate:{value:null,type:"any"},falseTemplate:{value:null,type:"any"},type:{value:"toggle",type:"string",defaultReflectToAttribute:!0,readonly:!0}}}static get listeners(){return{keydown:"_keyHandler",keyup:"_keyHandler",dragstart:"_dragStartHandler","button.click":"_buttonClickHandler","button.mouseenter":"_buttonMouseEnterHandler","button.mouseleave":"_buttonMouseLeaveHandler","document.up":"_documentUpHandler"}}ready(){super.ready(),this._setAriaState(),this._updateGroupValue()}_setAriaState(){const e=this,t=e.checked;null!==t?e.setAttribute("aria-pressed",t):e.setAttribute("aria-pressed","mixed")}_buttonClickHandler(){}_buttonMouseLeaveHandler(){this.removeAttribute("hover")}_buttonMouseEnterHandler(){const e=this;e.setAttribute("hover",""),e.disabled||e.readonly||"hover"!==e.clickMode||(e._changeCheckState("pointer"),e.focus(),e._updateHidenInputNameAndValue())}_documentUpHandler(e){const t=this;t._pressed&&(t._pressed=!1,t.disabled||t.readonly||"press"===t.clickMode||"pointercancel"===e.originalEvent.type||(t._changeCheckState("pointer"),t.focus(),t._updateHidenInputNameAndValue()))}_downHandler(e){const t=this;t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t._pressed=!0,"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||(t._changeCheckState("pointer"),t.hasAttribute("smart-blazor")?t.$.dispatchEvent(new Event("click")):t.$.fireEvent("click"),t._updateHidenInputNameAndValue()),"press"===t.clickMode&&(e.preventDefault(),e.stopPropagation()))}_dragStartHandler(e){e.preventDefault()}_keyHandler(e){const t=this;if(!0!==t.disabled&&!t.readonly&&32===e.keyCode){if("keydown"===e.type)return void e.preventDefault();if("none"===t.switchMode)return;t._changeCheckState("keyboard"),t._updateHidenInputNameAndValue()}}_updateGroupValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const n=document.querySelectorAll('[data-target="'+e.dataset.target+'"]'),a=[];if(e.checked){const n=e.dataset.property,a=e.dataset.value;if(n&&void 0!==t[n]){let e=a;"true"===e&&(e=!0),"false"===e&&(e=!1),t[n]=e}}for(let t=0;t<n.length;t++){const r=n[t];r.checked&&(r.name?(a.push(r.name),e.id&&r.setAttribute("data-id",e.id)):e.id&&a.push(e.id))}t.value=a.toString(),e._targetDispatchTimer&&clearTimeout(e._targetDispatchTimer),e._targetDispatchTimer=setTimeout((()=>{t.dispatchEvent(new Event("change"))}),100)}}}_changeCheckState(e){const t=this;let n=null;null===t.checked?t.checked=!0:(n=t.checked,t.checked=!t.checked),t._handleTextSelection(),t.$.fireEvent("change",{value:t.checked,oldValue:n,changeType:e}),t.checked?t.$.fireEvent("checkValue",{changeType:e}):t.$.fireEvent("uncheckValue",{changeType:e}),t._updateGroupValue(),t._setAriaState()}_handleTextSelection(){const e=this;e.$.addClass("smart-unselectable"),e.timer&&clearTimeout(e.timer),e.timer=setTimeout((()=>e.$.removeClass("smart-unselectable")),500)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;if("checked"===e)return a.$.fireEvent("change",{value:n,oldValue:t,changeType:"api"}),void a._setAriaState();switch(e){case"trueTemplate":a._handleTemplate(!0);break;case"falseTemplate":a._handleTemplate(!1);break;case"indeterminateTemplate":a._handleTemplate()}}_htmlBindOnInitialization(){const e=this;e._bindContentProperty("trueContent","smart-true-content"),e._bindContentProperty("falseContent","smart-false-content"),e._bindContentProperty("indeterminateContent","smart-indeterminate-content")}_bindContentProperty(e,t){const n=this;if(!n.$[e+"Container"])return;let a=document.createElement("div");a.innerHTML=n.innerHTML;let r,i=a.getElementsByClassName(t);if(i.length>0)for(let e=0;e<i.length;e++)r=i[e];""===n[e]&&(n[e]=void 0===r?"":r.outerHTML),n.$[e+"Container"].innerHTML=n[e]}_updateContentProperties(){const e=this;function t(t){e.$[t+"Container"]&&(e[t]=e.$[t+"Container"].innerHTML)}t("trueContent"),t("falseContent"),t("indeterminateContent")}_updateHidenInputValue(){const e=this;if(!e.$.hiddenInput)return;let t;t=null===e.checked?"null":!1===e.checked?"off":e.value||"on",e.$.hiddenInput.setAttribute("value",t)}_updateHidenInputName(){const e=this;if(!e.$.hiddenInput)return;let t=!1===e.checked?"":e.name||"";e.$.hiddenInput.setAttribute("name",t)}_updateHidenInputNameAndValue(){this._updateHidenInputName(),this._updateHidenInputValue()}_handleTemplate(e,t){const n=this;let a,r,i;if(!0===e?(a=n.trueTemplate,r=n.$.trueContentContainer,i=n.trueContent):!1===e?(a=n.falseTemplate,r=n.$.falseContentContainer,i=n.falseContent):(a=n.indeterminateTemplate,r=n.$.indeterminateContentContainer,i=n.indeterminateContent),t&&(r.innerHTML=i||""),null===a||!a)return;if("function"==typeof a)return void a(r,{value:i});if(!("content"in document.createElement("template")))return void n.error(n.localize("htmlTemplateNotSuported",{elementType:n.nodeName.toLowerCase()}));if(a=document.getElementById(a),null===a||!("content"in a))return void n.error(n.localize("invalidTemplate",{elementType:n.nodeName.toLowerCase(),property:"template"}));const o=a.content,l=o.childNodes.length,s=/{{\w+}}/g;let u,d=[];for(let e=0;e<l;e++)for(u=s.exec(o.childNodes[e].innerHTML);u;)d.push({childNodeIndex:e,bindingString:u[0]}),u=s.exec(o.childNodes[e].innerHTML);const c=d.length;let p,h,m=document.importNode(a.content,!0);for(let e=0;e<c;e++){p=m.childNodes[d[e].childNodeIndex],h=d.length;for(let t=0;t<h;t++)p.innerHTML=p.innerHTML.replace(d[e].bindingString,i)}r.innerHTML="";for(let e=0;e<m.childNodes.length;e++)m.childNodes[e].outerHTML&&(r.innerHTML+=m.childNodes[e].outerHTML)}});
|
|
6
|
+
Smart("smart-button",class extends Smart.ContentElement{static get properties(){return{value:{type:"string"},name:{type:"string"},type:{value:"button",type:"string"},clickMode:{allowedValues:["hover","press","release","pressAndRelease"],type:"string",value:"release"}}}static get styleUrls(){return["smart.button.css"]}template(){return"<button aria-label=\"Button\" class=\"smart-button smart-unselectable\" inner-h-t-m-l='[[innerHTML]]' id='button' type='[[type]]' name='[[name]]' value='[[value]]' disabled='[[disabled]]' role=\"presentation\"></button>"}refresh(){}static get listeners(){return{"button.down":"_downHandler","button.mouseenter":"_mouseEnterHandler","button.mouseleave":"_mouseLeaveHandler","button.touchend":"_touchEndHandler","button.click":"_clickHandler","button.up":"_upHandler",up:"_upHandler","button.focus":"_focusHandler","button.blur":"_blurHandler"}}focus(){const e=this;e.$.button?e.$.button.focus():HTMLElement.prototype.focus.call(e)}blur(){const e=this;e.$.button?e.$.button.blur():HTMLElement.prototype.blur.call(e)}_upHandler(e){const t=this;if(e.stopPropagation(),t.$.setAttributeValue("active",!1),t.dataset.target){const n=document.querySelector(t.dataset.target);let a=t.dataset.toggle,r=t.dataset.arguments;const i="smart-window".toLowerCase();if(n&&n.nodeName.toLowerCase()===i&&"modal"===a&&(a="openModal"),"tab"===a||"pill"===a||"list"===a){const e=this.closest(".nav, .list-group"),a='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',r=!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?e.children(".active"):e.querySelectorAll("li > .active");if(e){const n=e.querySelectorAll(a);for(let e=0;e<n.length;e++)n[e].classList.remove("primary");for(let e=0;e<r.length;e++)r[e].classList.remove("active");let i=t.parentNode;for(;i;){if("LI"===i.nodeName){i.classList.add("active");break}i=i.parentNode}t.classList.add("primary")}return n.parentNode.querySelectorAll(".active").forEach((e=>{e.classList.remove("active"),e.classList.add("smart-hidden")})),n.classList.add("active"),void n.classList.remove("smart-hidden")}a&&n&&!n[a]&&"collapse"===a&&(setTimeout((()=>{n.classList.contains("smart-hidden")?n.classList.remove("smart-hidden"):n.classList.add("smart-hidden")})),e.originalEvent.preventDefault()),a&&n&&!n[a]&&"dropdown"===a?(setTimeout((()=>{n.opened=!n.opened})),e.originalEvent.preventDefault()):a&&n&&n[a]&&(setTimeout((()=>{r?n[a](r):n[a]()}),50),e.originalEvent.preventDefault())}}_focusHandler(){this.$.setAttributeValue("focus",!0),this.$.fireEvent("focus")}_blurHandler(){this.$.setAttributeValue("focus",!1),this.$.fireEvent("blur")}_clickHandler(e){const t=this;("release"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly)&&(e.preventDefault(),e.stopPropagation())}_downHandler(e){const t=this;if(!(t.disabled||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t.$.setAttributeValue("active",!0),"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly))){if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_mouseEnterHandler(e){const t=this;if(!t.readonly&&(t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0),"hover"===t.clickMode)){const n="buttons"in e?e.buttons:e.which;if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_touchEndHandler(){const e=this;setTimeout((function(){e.$button.setAttributeValue("hover",!1),e.$.setAttributeValue("hover",!1)}),300)}_mouseLeaveHandler(){this.$button.setAttributeValue("hover",!1),this.$.setAttributeValue("hover",!1)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;"disabled"===e?(a._setFocusable(),a.$button&&a.$button.setAttributeValue("hover",!1),a.$.setAttributeValue("hover",!1),a instanceof Smart.RepeatButton&&a._stopRepeat()):"unfocusable"===e&&a._setFocusable()}_setFocusable(){const e=this,t=e.$.button?e.$.button:e;if(e.disabled||e.unfocusable)return t.removeAttribute("tabindex"),void(t.tabIndex=-1);t.tabIndex=e.tabIndex>0?e.tabIndex:0}ready(){const e=this;super.ready(),e.setAttribute("role","presentation"),e._setFocusable(),e.enableShadowDOM&&e.$.hiddenInput&&e.appendChild(e.$.hiddenInput)}}),Smart("smart-repeat-button",class extends Smart.Button{static get properties(){return{delay:{value:50,type:"number"},initialDelay:{value:150,type:"number"}}}static get listeners(){return{"button.down":"_startRepeat","button.mouseenter":"_overriddenHandler","button.mouseleave":"_overriddenHandler","button.pointerenter":"_updateInBoundsFlag","button.pointerleave":"_updateInBoundsFlag","button.touchmove":"_touchmoveHandler","document.up":"_stopRepeat"}}_clickHandler(e){const t=this;("release"!==t.clickMode||t.preventDefaultClick||t.readonly||t.disabled)&&(e.preventDefault(),e.stopPropagation(),t.preventDefaultClick=!1)}_updateInBoundsFlag(e){const t=this;-1!==e.type.indexOf("leave")?(t._isPointerInBounds=!1,t.$button.setAttributeValue("hover",!1),t.$.setAttributeValue("hover",!1)):(t._isPointerInBounds=!0,t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0)),1!==("buttons"in e?e.buttons:e.which)&&t._stopRepeat(e)}_startRepeat(e){const t=this;t.setAttribute("active",""),t._initialTimer||t.readonly||(t._initialTimer=setTimeout((function(){t._repeatTimer=setInterval((()=>{if(t._isPointerInBounds){if(t.hasAttribute("smart-blazor"))return t.$.dispatchEvent(new Event("click")),void(t.preventDefaultClick=!0);const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),t.preventDefaultClick=!0}}),t.delay)}),t.initialDelay))}_stopRepeat(e){const t=this;t.readonly||e&&("pointercancel"===e.type||e.originalEvent&&"pointercancel"===e.originalEvent.type)||(t.$.setAttributeValue("active",!1),t._repeatTimer&&(clearInterval(t._repeatTimer),t._repeatTimer=null),t._initialTimer&&(clearTimeout(t._initialTimer),t._initialTimer=null))}_touchmoveHandler(e){this.preventDefaultClick&&e.cancelable&&(e.preventDefault(),e.stopPropagation())}_overriddenHandler(){}}),Smart("smart-toggle-button",class extends Smart.Button{static get properties(){return{checked:{value:!1,type:"boolean?"},falseContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminate:{value:!1,type:"boolean"},trueContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateTemplate:{value:null,type:"any"},trueTemplate:{value:null,type:"any"},falseTemplate:{value:null,type:"any"},type:{value:"toggle",type:"string",defaultReflectToAttribute:!0,readonly:!0}}}static get listeners(){return{keydown:"_keyHandler",keyup:"_keyHandler",dragstart:"_dragStartHandler","button.click":"_buttonClickHandler","button.mouseenter":"_buttonMouseEnterHandler","button.mouseleave":"_buttonMouseLeaveHandler","document.up":"_documentUpHandler"}}ready(){super.ready(),this._setAriaState(),this._updateGroupValue()}_setAriaState(){const e=this,t=e.checked;null!==t?e.setAttribute("aria-pressed",t):e.setAttribute("aria-pressed","mixed")}_buttonClickHandler(){}_buttonMouseLeaveHandler(){this.removeAttribute("hover")}_buttonMouseEnterHandler(){const e=this;e.setAttribute("hover",""),e.disabled||e.readonly||"hover"!==e.clickMode||(e._changeCheckState("pointer"),e.focus(),e._updateHidenInputNameAndValue())}_documentUpHandler(e){const t=this;t._pressed&&(t._pressed=!1,t.disabled||t.readonly||"press"===t.clickMode||"pointercancel"===e.originalEvent.type||(t._changeCheckState("pointer"),t.focus(),t._updateHidenInputNameAndValue()))}_downHandler(e){const t=this;t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t._pressed=!0,"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||(t._changeCheckState("pointer"),t.hasAttribute("smart-blazor")?t.$.dispatchEvent(new Event("click")):t.$.fireEvent("click"),t._updateHidenInputNameAndValue()),"press"===t.clickMode&&(e.preventDefault(),e.stopPropagation()))}_dragStartHandler(e){e.preventDefault()}_keyHandler(e){const t=this;if(!0!==t.disabled&&!t.readonly&&32===e.keyCode){if("keydown"===e.type)return void e.preventDefault();if("none"===t.switchMode)return;t._changeCheckState("keyboard"),t._updateHidenInputNameAndValue()}}_updateGroupValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const n=document.querySelectorAll('[data-target="'+e.dataset.target+'"]'),a=[];if(e.checked){const n=e.dataset.property,a=e.dataset.value;if(n&&void 0!==t[n]){let e=a;"true"===e&&(e=!0),"false"===e&&(e=!1),t[n]=e}}for(let t=0;t<n.length;t++){const r=n[t];r.checked&&(r.name?(a.push(r.name),e.id&&r.setAttribute("data-id",e.id)):e.id&&a.push(e.id))}t.value=a.toString(),e._targetDispatchTimer&&clearTimeout(e._targetDispatchTimer),e._targetDispatchTimer=setTimeout((()=>{t.dispatchEvent(new Event("change"))}),100)}}}_changeCheckState(e){const t=this;let n=null;null===t.checked?t.checked=!0:(n=t.checked,t.checked=!t.checked),t._handleTextSelection(),t.$.fireEvent("change",{value:t.checked,oldValue:n,changeType:e}),t.checked?t.$.fireEvent("checkValue",{changeType:e}):t.$.fireEvent("uncheckValue",{changeType:e}),t._updateGroupValue(),t._setAriaState()}_handleTextSelection(){const e=this;e.$.addClass("smart-unselectable"),e.timer&&clearTimeout(e.timer),e.timer=setTimeout((()=>e.$.removeClass("smart-unselectable")),500)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;if("checked"===e)return a.$.fireEvent("change",{value:n,oldValue:t,changeType:"api"}),void a._setAriaState();switch(e){case"trueTemplate":a._handleTemplate(!0);break;case"falseTemplate":a._handleTemplate(!1);break;case"indeterminateTemplate":a._handleTemplate()}}_htmlBindOnInitialization(){const e=this;e._bindContentProperty("trueContent","smart-true-content"),e._bindContentProperty("falseContent","smart-false-content"),e._bindContentProperty("indeterminateContent","smart-indeterminate-content")}_bindContentProperty(e,t){const n=this;if(!n.$[e+"Container"])return;let a=document.createElement("div");a.innerHTML=n.innerHTML;let r,i=a.getElementsByClassName(t);if(i.length>0)for(let e=0;e<i.length;e++)r=i[e];""===n[e]&&(n[e]=void 0===r?"":r.outerHTML),n.$[e+"Container"].innerHTML=n[e]}_updateContentProperties(){const e=this;function t(t){e.$[t+"Container"]&&(e[t]=e.$[t+"Container"].innerHTML)}t("trueContent"),t("falseContent"),t("indeterminateContent")}_updateHidenInputValue(){const e=this;if(!e.$.hiddenInput)return;let t;t=null===e.checked?"null":!1===e.checked?"off":e.value||"on",e.$.hiddenInput.setAttribute("value",t)}_updateHidenInputName(){const e=this;if(!e.$.hiddenInput)return;let t=!1===e.checked?"":e.name||"";e.$.hiddenInput.setAttribute("name",t)}_updateHidenInputNameAndValue(){this._updateHidenInputName(),this._updateHidenInputValue()}_handleTemplate(e,t){const n=this;let a,r,i;if(!0===e?(a=n.trueTemplate,r=n.$.trueContentContainer,i=n.trueContent):!1===e?(a=n.falseTemplate,r=n.$.falseContentContainer,i=n.falseContent):(a=n.indeterminateTemplate,r=n.$.indeterminateContentContainer,i=n.indeterminateContent),t&&(r.innerHTML=i||""),null===a||!a)return;if("function"==typeof a)return void a(r,{value:i});if(!("content"in document.createElement("template")))return void n.error(n.localize("htmlTemplateNotSuported",{elementType:n.nodeName.toLowerCase()}));if(a=document.getElementById(a),null===a||!("content"in a))return void n.error(n.localize("invalidTemplate",{elementType:n.nodeName.toLowerCase(),property:"template"}));const o=a.content,l=o.childNodes.length,s=/{{\w+}}/g;let u,d=[];for(let e=0;e<l;e++)for(u=s.exec(o.childNodes[e].innerHTML);u;)d.push({childNodeIndex:e,bindingString:u[0]}),u=s.exec(o.childNodes[e].innerHTML);const c=d.length;let p,h,m=document.importNode(a.content,!0);for(let e=0;e<c;e++){p=m.childNodes[d[e].childNodeIndex],h=d.length;for(let t=0;t<h;t++)p.innerHTML=p.innerHTML.replace(d[e].bindingString,i)}r.innerHTML="";for(let e=0;e<m.childNodes.length;e++)m.childNodes[e].outerHTML&&(r.innerHTML+=m.childNodes[e].outerHTML)}});
|