@smart-webcomponents-angular/window 24.0.16 → 25.0.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/index.d.ts +98 -122
- package/package.json +1 -1
- package/source/modules/smart.window.js +1 -1
- package/source/smart.button.js +2 -2
- package/source/smart.combobox.js +2 -2
- package/source/smart.dropdownlist.js +2 -2
- package/source/smart.element.js +2 -2
- package/source/smart.listbox.js +2 -2
- package/source/smart.multilinetextbox.js +2 -2
- package/source/smart.progressbar.js +2 -2
- package/source/smart.scrollbar.js +1 -1
- package/source/smart.textbox.js +1 -1
- package/source/smart.window.js +2 -2
- package/styles/smart.base.css +1 -1
- package/styles/smart.window.css +1 -1
package/index.d.ts
CHANGED
|
@@ -2027,7 +2027,7 @@ export interface BreadcrumbProperties {
|
|
|
2027
2027
|
*/
|
|
2028
2028
|
disabled?: boolean;
|
|
2029
2029
|
/**
|
|
2030
|
-
* Defines the template used to render each breadcrumb item. This property accepts either the ID of an '' element (as a string) or a reference to an actual 'HTMLTemplateElement'. When specified, the template determines the structure and content of each breadcrumb item. If set to 'null', the default rendering is used and no custom template is applied.
|
|
2030
|
+
* Defines the template used to render each breadcrumb item. This property accepts either the ID of an '<template>' element (as a string) or a reference to an actual 'HTMLTemplateElement'. When specified, the template determines the structure and content of each breadcrumb item. If set to 'null', the default rendering is used and no custom template is applied.
|
|
2031
2031
|
* Default value: null
|
|
2032
2032
|
*/
|
|
2033
2033
|
itemTemplate?: any;
|
|
@@ -2436,7 +2436,7 @@ export interface CalendarProperties {
|
|
|
2436
2436
|
*/
|
|
2437
2437
|
firstDayOfWeek?: number;
|
|
2438
2438
|
/**
|
|
2439
|
-
* Defines a custom footer template for the component. You can provide either the ID of an existing '' element in the DOM, or pass a direct reference to an 'HTMLTemplateElement'. The specified template will be used to render the footer section of the component.
|
|
2439
|
+
* Defines a custom footer template for the component. You can provide either the ID of an existing '<template>' element in the DOM, or pass a direct reference to an 'HTMLTemplateElement'. The specified template will be used to render the footer section of the component.
|
|
2440
2440
|
* Default value: null
|
|
2441
2441
|
*/
|
|
2442
2442
|
footerTemplate?: any;
|
|
@@ -2466,7 +2466,7 @@ export interface CalendarProperties {
|
|
|
2466
2466
|
*/
|
|
2467
2467
|
importantDates?: string[] | Date[];
|
|
2468
2468
|
/**
|
|
2469
|
-
* Defines a template for displaying important dates. This property accepts either the ID of an HTML '' element present in the DOM, or a direct reference to that template element. The specified template will be used to render each important date in the component.
|
|
2469
|
+
* Defines a template for displaying important dates. This property accepts either the ID of an HTML '<template>' element present in the DOM, or a direct reference to that template element. The specified template will be used to render each important date in the component.
|
|
2470
2470
|
* Default value: null
|
|
2471
2471
|
*/
|
|
2472
2472
|
importantDatesTemplate?: any;
|
|
@@ -2607,7 +2607,7 @@ export interface CalendarProperties {
|
|
|
2607
2607
|
*/
|
|
2608
2608
|
tooltipPosition?: TooltipPosition | string;
|
|
2609
2609
|
/**
|
|
2610
|
-
* Defines the template used for the tooltip's content. You can provide either the ID of an existing '' element in the DOM or a direct reference to an HTMLTemplateElement. The tooltip will render its content based on the markup and structure defined within the specified template.
|
|
2610
|
+
* Defines the template used for the tooltip's content. You can provide either the ID of an existing '<template>' element in the DOM or a direct reference to an HTMLTemplateElement. The tooltip will render its content based on the markup and structure defined within the specified template.
|
|
2611
2611
|
* Default value: null
|
|
2612
2612
|
*/
|
|
2613
2613
|
tooltipTemplate?: any;
|
|
@@ -2768,7 +2768,7 @@ export interface CardProperties {
|
|
|
2768
2768
|
*/
|
|
2769
2769
|
disabled?: boolean;
|
|
2770
2770
|
/**
|
|
2771
|
-
* Specifies a custom card template for rendering card content. The template can be provided either as a string representing the ID of an '' element present in the DOM, or as a direct reference to an HTMLTemplateElement. Within the template’s HTML content, you may include one or more property placeholders using the double curly braces syntax. During rendering, each placeholder will be dynamically replaced with the corresponding property value from the associated 'dataSource' object. If you set this property using a template ID, the expected type is a string.
|
|
2771
|
+
* Specifies a custom card template for rendering card content. The template can be provided either as a string representing the ID of an '<template>' element present in the DOM, or as a direct reference to an HTMLTemplateElement. Within the template’s HTML content, you may include one or more property placeholders using the double curly braces syntax. During rendering, each placeholder will be dynamically replaced with the corresponding property value from the associated 'dataSource' object. If you set this property using a template ID, the expected type is a string.
|
|
2772
2772
|
* Default value: null
|
|
2773
2773
|
*/
|
|
2774
2774
|
itemTemplate?: any;
|
|
@@ -5802,7 +5802,7 @@ export interface ChipProperties {
|
|
|
5802
5802
|
*/
|
|
5803
5803
|
disabled?: boolean;
|
|
5804
5804
|
/**
|
|
5805
|
-
* Specifies a custom template for the chip component. The template can be provided either as a string representing the ID of an existing '' element in the DOM, or as a direct reference to an 'HTMLTemplateElement' instance. This allows developers to define and reuse custom chip layouts within the application.
|
|
5805
|
+
* Specifies a custom template for the chip component. The template can be provided either as a string representing the ID of an existing '<template>' element in the DOM, or as a direct reference to an 'HTMLTemplateElement' instance. This allows developers to define and reuse custom chip layouts within the application.
|
|
5806
5806
|
* Default value: null
|
|
5807
5807
|
*/
|
|
5808
5808
|
itemTemplate?: any;
|
|
@@ -8657,7 +8657,7 @@ export interface DateTimePickerProperties {
|
|
|
8657
8657
|
*/
|
|
8658
8658
|
importantDates?: string[] | Date[];
|
|
8659
8659
|
/**
|
|
8660
|
-
* Defines the template used to display important dates within the calendar pop-up. This property accepts either the ID of an existing '' element or a direct reference to an 'HTMLTemplateElement' in the DOM. The specified template determines how important dates are rendered inside the calendar interface, allowing for custom formatting and content.
|
|
8660
|
+
* Defines the template used to display important dates within the calendar pop-up. This property accepts either the ID of an existing '<template>' element or a direct reference to an 'HTMLTemplateElement' in the DOM. The specified template determines how important dates are rendered inside the calendar interface, allowing for custom formatting and content.
|
|
8661
8661
|
* Default value: null
|
|
8662
8662
|
*/
|
|
8663
8663
|
importantDatesTemplate?: string | HTMLTemplateElement;
|
|
@@ -8791,7 +8791,7 @@ export interface DateTimePickerProperties {
|
|
|
8791
8791
|
*/
|
|
8792
8792
|
tooltipPosition?: TooltipPosition | string;
|
|
8793
8793
|
/**
|
|
8794
|
-
* Defines a custom template for the tooltip content displayed in the calendar pop-up. This property accepts either the ID of an HTML
|
|
8794
|
+
* Defines a custom template for the tooltip content displayed in the calendar pop-up. This property accepts either the ID of an HTML <template> element or a direct reference to an HTMLTemplateElement. The specified template will be used to render the tooltip, allowing for customized layout and content in the calendar interface.
|
|
8795
8795
|
* Default value: null
|
|
8796
8796
|
*/
|
|
8797
8797
|
tooltipTemplate?: string | HTMLTemplateElement;
|
|
@@ -15473,10 +15473,20 @@ export interface GridProperties {
|
|
|
15473
15473
|
*/
|
|
15474
15474
|
columnGroups?: GridColumnGroup[];
|
|
15475
15475
|
/**
|
|
15476
|
-
*
|
|
15476
|
+
* Enables or disables the dropdown mode for the component. When true, the component displays as a dropdown instead of a standard input or list.
|
|
15477
15477
|
* Default value: false
|
|
15478
15478
|
*/
|
|
15479
15479
|
dropDownMode?: boolean;
|
|
15480
|
+
/**
|
|
15481
|
+
* Determines whether the dropdown mode allows text input. When true, users can type in the dropdown field; otherwise, selection is restricted to the provided list items.
|
|
15482
|
+
* Default value: false
|
|
15483
|
+
*/
|
|
15484
|
+
dropDownModeInput?: boolean;
|
|
15485
|
+
/**
|
|
15486
|
+
* Specifies the data field or property to display in dropdown mode. This is the field from the data source that will be shown as the dropdown options.
|
|
15487
|
+
* Default value: ""
|
|
15488
|
+
*/
|
|
15489
|
+
dropDownModeDataField?: string;
|
|
15480
15490
|
/**
|
|
15481
15491
|
* Defines or retrieves the rules and settings for conditional formatting applied to the Grid's cells, allowing you to customize cell appearance (such as background color, font style, or icons) based on specific conditions or cell values.
|
|
15482
15492
|
* Default value: null
|
|
@@ -15506,7 +15516,7 @@ export interface GridProperties {
|
|
|
15506
15516
|
* Configures the grid’s data source when the dataSource property is assigned either a JavaScript array (for local data) or a URL (for remote data). This setting determines how the grid retrieves and displays its data, supporting both direct array binding and remote data fetching via HTTP requests.
|
|
15507
15517
|
* Default value: [object Object]
|
|
15508
15518
|
*/
|
|
15509
|
-
dataSourceSettings?:
|
|
15519
|
+
dataSourceSettings?: any;
|
|
15510
15520
|
/**
|
|
15511
15521
|
* Provides comprehensive configuration options for controlling the grid's editing behavior, including enabling or disabling editing features, specifying editing modes (such as inline, popup, or batch), setting validation rules, and customizing editors for specific columns.
|
|
15512
15522
|
* Default value: [object Object]
|
|
@@ -17093,6 +17103,16 @@ export interface GridAi {
|
|
|
17093
17103
|
* Default value: ""
|
|
17094
17104
|
*/
|
|
17095
17105
|
key?: string;
|
|
17106
|
+
/**
|
|
17107
|
+
* Sets or gets the AI Assistant's prompts.
|
|
17108
|
+
* Default value: []
|
|
17109
|
+
*/
|
|
17110
|
+
prompts?: any[];
|
|
17111
|
+
/**
|
|
17112
|
+
* Sets or gets the AI Assistant's prompts variables which will be replaced in the AI prompts. Ex: promptVariables: [{ name: 'review', dataField: 'review' }, { name: 'rating', dataField: 'rating' } ]
|
|
17113
|
+
* Default value: []
|
|
17114
|
+
*/
|
|
17115
|
+
promptVariables?: any[];
|
|
17096
17116
|
}
|
|
17097
17117
|
|
|
17098
17118
|
/**An object that defines configuration options controlling the grid’s behavior, such as layout properties, sorting and filtering capabilities, selection modes, and responsiveness settings. */
|
|
@@ -17273,6 +17293,11 @@ export interface GridColumn {
|
|
|
17273
17293
|
* Default value: null
|
|
17274
17294
|
*/
|
|
17275
17295
|
cellsCSSRules?: any;
|
|
17296
|
+
/**
|
|
17297
|
+
* Sets or gets whether the column is collapsed.
|
|
17298
|
+
* Default value: false
|
|
17299
|
+
*/
|
|
17300
|
+
collapsed?: boolean;
|
|
17276
17301
|
/**
|
|
17277
17302
|
* Sets or gets the column's cells renderer function for custom html rendering in the cells. For more advanced scenarios use formatFunction or template, but for simple html rendering, you can use this.
|
|
17278
17303
|
* Default value: null
|
|
@@ -17308,6 +17333,11 @@ export interface GridColumn {
|
|
|
17308
17333
|
* Default value: null
|
|
17309
17334
|
*/
|
|
17310
17335
|
dataSet?: any;
|
|
17336
|
+
/**
|
|
17337
|
+
* Sets or gets which columns will be expanded/collapsed when the column is collapsible. The property expects an array of data fields.
|
|
17338
|
+
* Default value:
|
|
17339
|
+
*/
|
|
17340
|
+
detailColumns?: any[];
|
|
17311
17341
|
/**
|
|
17312
17342
|
* Gets the HTML Element. The property returns null when the Column is not in the View.
|
|
17313
17343
|
* Default value: null
|
|
@@ -17325,9 +17355,9 @@ export interface GridColumn {
|
|
|
17325
17355
|
freeze?: Position | string;
|
|
17326
17356
|
/**
|
|
17327
17357
|
* Sets or gets the filter of the column. Example: ['contains Andrew or contains Nancy']. Example with numeric filter ['quantity', '<= 3 and >= 8']. Additional example with filter which we want to apply to a column with filterMenuMode='excel' - ['EQUAL' 'Andrew' or 'EQUAL' 'Antoni' or 'EQUAL' 'Beate']. Example with a string filter applied to a string column - ['CONTAINS' 'burke' or 'CONTAINS' 'peterson']. Filter conditions which you can use in the expressions: '=', 'EQUAL','<>', 'NOT_EQUAL', '!=', '<', 'LESS_THAN','>', 'GREATER_THAN', '<=', 'LESS_THAN_OR_EQUAL', '>=', 'GREATER_THAN_OR_EQUAL','starts with', 'STARTS_WITH','ends with', 'ENDS_WITH', '', 'EMPTY', 'CONTAINS','DOES_NOT_CONTAIN', 'NULL','NOT_NULL'
|
|
17328
|
-
* Default value:
|
|
17358
|
+
* Default value:
|
|
17329
17359
|
*/
|
|
17330
|
-
filter?:
|
|
17360
|
+
filter?: any;
|
|
17331
17361
|
/**
|
|
17332
17362
|
* Sets or gets the filter menu mode of the column. In 'basic' mode, a single input is displayed in the filter menu. In 'default' mode, two input options are available for more precise filtering. In 'excel' mode, checked list with unique values is displayed.
|
|
17333
17363
|
* Default value: default
|
|
@@ -17383,6 +17413,11 @@ export interface GridColumn {
|
|
|
17383
17413
|
* Default value:
|
|
17384
17414
|
*/
|
|
17385
17415
|
labelTemplate?: string | HTMLTemplateElement | HTMLElement | {(label: string): string};
|
|
17416
|
+
/**
|
|
17417
|
+
* Sets or gets the column header's template function. The property expects a function(element) { } which can be used to set up the column's header label.
|
|
17418
|
+
* Default value: null
|
|
17419
|
+
*/
|
|
17420
|
+
headerTemplate?: HTMLElement;
|
|
17386
17421
|
/**
|
|
17387
17422
|
* Sets or gets the minimum width.
|
|
17388
17423
|
* Default value: 30
|
|
@@ -17443,6 +17478,16 @@ export interface GridColumn {
|
|
|
17443
17478
|
* Default value:
|
|
17444
17479
|
*/
|
|
17445
17480
|
width?: string | number;
|
|
17481
|
+
/**
|
|
17482
|
+
* Sets or gets the column's tooltip.
|
|
17483
|
+
* Default value: ""
|
|
17484
|
+
*/
|
|
17485
|
+
tooltip?: string;
|
|
17486
|
+
/**
|
|
17487
|
+
* Sets or gets the column's tooltip renderer which renders tooltips for the column cells. (rowId, dataField, cellValue, formattedValue, data)
|
|
17488
|
+
* Default value: null
|
|
17489
|
+
*/
|
|
17490
|
+
tooltipRenderer?: any;
|
|
17446
17491
|
/**
|
|
17447
17492
|
* Sets or gets the column's template. The property expects the 'id' of HTMLTemplateElement or HTML string which is displayed in the cells. Built-in string values are: 'checkBox', 'switchButton', 'url', 'email', 'dropdownlist', 'list', 'progress', 'tags', 'autoNumber', 'modifiedBy', 'createdBy', 'createdTime', 'modifiedTime', 'images', 'checklist', 'attachments', 'sparklines', 'richText', 'color', 'rating', 'duration', 'startDate', 'dueDates'. For example, when you set the template to 'url', the cells will be render anchor tags. When you set the template property to HTMLTemplateElement you should consider that once a template is rendered, the formatObject.template property stores the rendered template component for further use.
|
|
17448
17493
|
* Default value:
|
|
@@ -17696,6 +17741,11 @@ export interface GridColumnGroup {
|
|
|
17696
17741
|
* Default value: center
|
|
17697
17742
|
*/
|
|
17698
17743
|
align?: HorizontalAlignment | string;
|
|
17744
|
+
/**
|
|
17745
|
+
* Sets whether the column group can be collapsed.
|
|
17746
|
+
* Default value: false
|
|
17747
|
+
*/
|
|
17748
|
+
collapsible?: boolean;
|
|
17699
17749
|
/**
|
|
17700
17750
|
* Sets the name of the column group.
|
|
17701
17751
|
* Default value: ""
|
|
@@ -17952,103 +18002,6 @@ export interface GridDataExport {
|
|
|
17952
18002
|
exportAsTable?: boolean;
|
|
17953
18003
|
}
|
|
17954
18004
|
|
|
17955
|
-
/**Configures the grid’s data source when the <em>dataSource</em> property is assigned either a JavaScript array (for local data) or a URL (for remote data). This setting determines how the grid retrieves and displays its data, supporting both direct array binding and remote data fetching via HTTP requests. */
|
|
17956
|
-
export interface GridDataSourceSettings {
|
|
17957
|
-
/**
|
|
17958
|
-
* Specifies whether a column should be automatically generated by the system (such as for identity or timestamp fields). When set, the column’s value will be created by the database or application rather than provided manually. This property can be read to determine if the column is currently set to auto-generate its values, or written to enable or disable automatic generation.
|
|
17959
|
-
* Default value: false
|
|
17960
|
-
*/
|
|
17961
|
-
autoGenerateColumns?: boolean;
|
|
17962
|
-
/**
|
|
17963
|
-
* Specifies the name of the data field—such as 'children' or 'items'—that contains nested child items within each object in the data source. When this property is set, the dataAdapter searches for this specified field in each item while processing the data. If the field is present, the dataAdapter treats the data as hierarchical and automatically constructs a hierarchical data structure, allowing for nested or tree-like representations. This property can be both retrieved (get) and updated (set) as needed.
|
|
17964
|
-
* Default value: ""
|
|
17965
|
-
*/
|
|
17966
|
-
childrenDataField?: string;
|
|
17967
|
-
/**
|
|
17968
|
-
* Sets or retrieves the root element used for XML data binding. This property specifies the top-level XML element that serves as the entry point for mapping XML data to objects, or for serializing objects to XML.
|
|
17969
|
-
* Default value: blackList
|
|
17970
|
-
*/
|
|
17971
|
-
sanitizeHTML?: GridDataSourceSettingsSanitizeHTML | string;
|
|
17972
|
-
/**
|
|
17973
|
-
* Gets or sets the root element used for XML data binding, which serves as the primary node for mapping XML data to object structures or vice versa.
|
|
17974
|
-
* Default value: ""
|
|
17975
|
-
*/
|
|
17976
|
-
root?: string;
|
|
17977
|
-
/**
|
|
17978
|
-
* Gets or sets the XML binding record, which defines the mapping between XML data and the corresponding data structure in the application. Use this property to retrieve the current binding configuration or to assign a new XML binding record for data serialization and deserialization operations.
|
|
17979
|
-
* Default value: ""
|
|
17980
|
-
*/
|
|
17981
|
-
record?: string;
|
|
17982
|
-
/**
|
|
17983
|
-
* Specifies or retrieves the fields used to group the data. When set, this property determines which data fields will be used to organize the dataset into groups, allowing for aggregation or categorization based on the specified fields.
|
|
17984
|
-
* Default value: []
|
|
17985
|
-
*/
|
|
17986
|
-
groupBy?: string[];
|
|
17987
|
-
/**
|
|
17988
|
-
* Defines or retrieves the schema that describes the structure of the loaded data, including both the field names and their corresponding data types. For example: ['id: number', 'firstName: string', 'lastName: string'] specifies that the data has three fields—id as a number, firstName as a string, and lastName as a string. This property ensures that the data adheres to the expected format for processing and validation.
|
|
17989
|
-
* Default value: null
|
|
17990
|
-
*/
|
|
17991
|
-
dataFields?: GridDataSourceSettingsDataField[];
|
|
17992
|
-
/**
|
|
17993
|
-
* Specifies or retrieves the type of data source being used, allowing you to define or query the data source format (such as JSON, XML, or a database connection).
|
|
17994
|
-
* Default value: array
|
|
17995
|
-
*/
|
|
17996
|
-
dataSourceType?: GridDataSourceSettingsDataSourceType | string;
|
|
17997
|
-
/**
|
|
17998
|
-
* Sets or retrieves the unique identifier (ID) associated with the dataAdapter instance. This ID can be used to distinguish between multiple dataAdapters in your application and for referencing or managing them programmatically.
|
|
17999
|
-
* Default value: ""
|
|
18000
|
-
*/
|
|
18001
|
-
id?: string;
|
|
18002
|
-
/**
|
|
18003
|
-
* Specifies the data field that uniquely identifies each item in the hierarchy, typically using the 'id' field. This property works in conjunction with the parentDataField property, which defines the field that refers to the parent item's identifier (commonly 'parentId'). Together, these fields establish the hierarchical structure by linking each child item to its parent. This property can be used to both set and retrieve the key field used for building the hierarchy.
|
|
18004
|
-
* Default value: ""
|
|
18005
|
-
*/
|
|
18006
|
-
keyDataField?: string;
|
|
18007
|
-
/**
|
|
18008
|
-
* Specifies the data field that identifies the parent node for each item in a hierarchical data structure. This property is used together with the keyDataField property to establish relationships between items—typically, keyDataField refers to the unique identifier of an item (commonly the 'id' field), while the parentDataField references the identifier of the item's parent (often the 'parentId' field). This setup allows the component to construct the hierarchy by linking each item to its parent based on matching key and parent values.
|
|
18009
|
-
* Default value: ""
|
|
18010
|
-
*/
|
|
18011
|
-
parentDataField?: string;
|
|
18012
|
-
/**
|
|
18013
|
-
* Updates the value of the 'mapChar' field within the record, assigning it a specified character or string. This field typically stores data related to mapping or identification purposes within the record object.
|
|
18014
|
-
* Default value: "."
|
|
18015
|
-
*/
|
|
18016
|
-
mapChar?: string;
|
|
18017
|
-
/**
|
|
18018
|
-
* Controls the grid’s relational data configuration. This property accepts an array of relation definition objects, where each object must include the following fields: - 'id' *(string)*: A unique identifier for the relation. - 'label' *(string)*: A descriptive name for the relation, used for display purposes. - 'columns' *(GridColumn[])*: An array of grid column definitions associated with this relation. - 'dataSource' *(any)*: The data source from which related records are retrieved (e.g., an array, function, or external API endpoint).Once you have defined the grid relations, you can reference them in individual column configurations by specifying the 'relationId' (to link the column to a relation) and 'relationField' (to indicate which field from the related data to use). When these properties are set, the grid will automatically generate an appropriate column editor (such as a dropdown or lookup field) that leverages the provided relation settings, streamlining data entry and ensuring data consistency.
|
|
18019
|
-
* Default value: null
|
|
18020
|
-
*/
|
|
18021
|
-
relations?: any;
|
|
18022
|
-
/**
|
|
18023
|
-
* Defines the virtual data source function, which is invoked by the Grid every time it needs to fetch data—such as when the user scrolls or sorts. This function should use the provided parameters to retrieve or generate the required data, and then pass the results back to the Grid by calling the callback function with the new data set. For example: resultCallbackFunction({dataSource: data}); This approach enables efficient data loading for large datasets by fetching only the necessary records as needed (virtual scrolling). For a working example, refer to the Grid demos page: https://www.htmlelements.com/demos/grid/virtualscroll/
|
|
18024
|
-
* Default value: null
|
|
18025
|
-
*/
|
|
18026
|
-
virtualDataSource?: {(resultCallbackFunction: any, details: DataAdapterVirtualDataSourceDetails): void};
|
|
18027
|
-
/**
|
|
18028
|
-
* Enhances the virtual data source during node expansion in Tree and TreeGrid components. When these components are configured with a virtualDataSource, this function is triggered each time a node is expanded and additional data needs to be loaded on demand. It enables efficient, real-time loading of child node data only as needed, supporting large data sets without preloading the entire hierarchy. For implementation details and a live demonstration, see: https://www.htmlelements.com/demos/grid/virtual-tree-grid/
|
|
18029
|
-
* Default value: null
|
|
18030
|
-
*/
|
|
18031
|
-
virtualDataSourceOnExpand?: any;
|
|
18032
|
-
}
|
|
18033
|
-
|
|
18034
|
-
export interface GridDataSourceSettingsDataField {
|
|
18035
|
-
/**
|
|
18036
|
-
* Sets the dataField name.
|
|
18037
|
-
* Default value: ""
|
|
18038
|
-
*/
|
|
18039
|
-
name?: string;
|
|
18040
|
-
/**
|
|
18041
|
-
* Sets the dataField mapping path. For nested mapping, use '.'. Example: 'name.firstName'.
|
|
18042
|
-
* Default value: ""
|
|
18043
|
-
*/
|
|
18044
|
-
map?: string;
|
|
18045
|
-
/**
|
|
18046
|
-
* Sets the dataField type.
|
|
18047
|
-
* Default value: string
|
|
18048
|
-
*/
|
|
18049
|
-
dataType?: GridDataSourceSettingsDataFieldDataType | string;
|
|
18050
|
-
}
|
|
18051
|
-
|
|
18052
18005
|
/**Provides comprehensive configuration options for controlling the grid's editing behavior, including enabling or disabling editing features, specifying editing modes (such as inline, popup, or batch), setting validation rules, and customizing editors for specific columns. */
|
|
18053
18006
|
export interface GridEditing {
|
|
18054
18007
|
/**
|
|
@@ -18061,6 +18014,11 @@ export interface GridEditing {
|
|
|
18061
18014
|
* Default value: false
|
|
18062
18015
|
*/
|
|
18063
18016
|
allowColumnHeaderEdit?: boolean;
|
|
18017
|
+
/**
|
|
18018
|
+
* Shows a Calendar or Spin Buttons when you hover an editable Date or Number Cells.
|
|
18019
|
+
* Default value: false
|
|
18020
|
+
*/
|
|
18021
|
+
allowDynamicButtons?: any;
|
|
18064
18022
|
/**
|
|
18065
18023
|
* Automatically reapplies any previously set column filters and sort orders after an edit is made, ensuring that user-defined table views remain consistent and uninterrupted following data modifications.
|
|
18066
18024
|
* Default value: true
|
|
@@ -18351,7 +18309,7 @@ export interface GridFiltering {
|
|
|
18351
18309
|
* An array specifying the filtering conditions to be applied to the DataGrid. Each element in the 'filter' array represents a single filter and is itself an array with two elements:1. 'Column dataField:' The name of the column to which the filter will be applied.2. 'Filter condition(s):' A string or expression that defines the criteria to filter the column’s data. This can include a condition or multiple conditions combined using logical operators such as 'or' and 'and'.'Example 1:' To search for rows where the "firstName" column contains 'Andrew' or 'Nancy', and the "quantity" column is either less than or equal to 3 or greater than or equal to 8:'''js[ ['firstName', 'contains Andrew or contains Nancy'], ['quantity', '= 8']]''''Example 2:' For columns configured with 'filterMenuMode: "excel"', you can express multiple "equals" conditions:'''js[ ['firstName', 'EQUAL Andrew or EQUAL Antoni or EQUAL Beate']]''''Example 3:' To filter a string column for values containing either 'burke' or 'peterson':'''js[ ['lastName', 'CONTAINS burke or CONTAINS peterson']]''''Supported filter operators:' You may use a variety of filter operators and keywords within filter expressions. Common operators include:- Equality: '=', 'EQUAL'- Inequality: '!=', '- Comparison: '', 'GREATER_THAN', '=', 'GREATER_THAN_OR_EQUAL'- String matching: 'CONTAINS', 'DOES_NOT_CONTAIN', 'STARTS_WITH', 'ENDS_WITH'- Special: 'EMPTY', 'NULL', 'NOT_NULL'Multiple conditions can be combined in a single expression with logical operators ('and', 'or'). This flexible structure enables complex filtering based on your DataGrid’s current columns and data types.
|
|
18352
18310
|
* Default value:
|
|
18353
18311
|
*/
|
|
18354
|
-
filter?: any
|
|
18312
|
+
filter?: any;
|
|
18355
18313
|
/**
|
|
18356
18314
|
* Provides detailed configuration options for the filter row, including its appearance, behavior, available filter types, and display settings. This allows developers to customize how the filter row is shown and how users interact with filtering features in the component.
|
|
18357
18315
|
* Default value: [object Object]
|
|
@@ -19457,19 +19415,13 @@ export declare type GridClipboardAutoFillMode = 'none' | 'copy' | 'fillSeries';
|
|
|
19457
19415
|
/**Sets or retrieves the position of the checkbox selection column within a table or grid, allowing you to specify whether the checkbox column appears at the start (left) or end (right) of the columns. */
|
|
19458
19416
|
export declare type Position = 'near' | 'far';
|
|
19459
19417
|
/**Sets or gets the filter menu mode of the column. In 'basic' mode, a single input is displayed in the filter menu. In 'default' mode, two input options are available for more precise filtering. In 'excel' mode, checked list with unique values is displayed. */
|
|
19460
|
-
export declare type GridColumnFilterMenuMode = 'basic' | 'default' | 'excel';
|
|
19418
|
+
export declare type GridColumnFilterMenuMode = 'basic' | 'default' | 'excel' | 'multi';
|
|
19461
19419
|
/**Sets or gets the sort order of the column. Accepts: 'asc', 'desc', 'none' and null. */
|
|
19462
19420
|
export declare type GridColumnSortOrder = 'asc' | 'desc' | 'none';
|
|
19463
19421
|
/**The formatting condition. */
|
|
19464
19422
|
export declare type GridConditionalFormattingCondition = 'between' | 'equal' | 'greaterThan' | 'lessThan' | 'notEqual';
|
|
19465
19423
|
/**Specifies the orientation of the page (portrait or landscape) when exporting the document to PDF format. This setting determines how the content is laid out on each PDF page. */
|
|
19466
19424
|
export declare type GridDataExportPageOrientation = 'landscape' | 'portrait';
|
|
19467
|
-
/**Sets or retrieves the root element used for XML data binding. This property specifies the top-level XML element that serves as the entry point for mapping XML data to objects, or for serializing objects to XML. */
|
|
19468
|
-
export declare type GridDataSourceSettingsSanitizeHTML = 'all' | 'blackList' | 'none';
|
|
19469
|
-
/**Sets the dataField type. */
|
|
19470
|
-
export declare type GridDataSourceSettingsDataFieldDataType = 'string' | 'date' | 'boolean' | 'number' | 'array' | 'any';
|
|
19471
|
-
/**Specifies or retrieves the type of data source being used, allowing you to define or query the data source format (such as JSON, XML, or a database connection). */
|
|
19472
|
-
export declare type GridDataSourceSettingsDataSourceType = 'array' | 'json' | 'xml' | 'csv' | 'tsv';
|
|
19473
19425
|
/**Specifies the method by which the editing mode is activated, such as through a single click, double click, or keyboard action. */
|
|
19474
19426
|
export declare type GridEditingAction = 'none' | 'click' | 'doubleClick';
|
|
19475
19427
|
/**Defines the content or label displayed within the buttons of the command column, such as text, icons, or custom HTML elements. This determines what users see and interact with in each command button cell. */
|
|
@@ -20012,6 +19964,11 @@ export interface KanbanProperties {
|
|
|
20012
19964
|
* Default value:
|
|
20013
19965
|
*/
|
|
20014
19966
|
currentUser?: string | number;
|
|
19967
|
+
/**
|
|
19968
|
+
* Controls whether a confirm dialog is displayed when a task is dragged and dropped to a new position
|
|
19969
|
+
* Default value: false
|
|
19970
|
+
*/
|
|
19971
|
+
confirmDialog?: boolean;
|
|
20015
19972
|
/**
|
|
20016
19973
|
* Controls whether the default dialog for adding or removing tasks or comments is enabled or disabled. When set to true, the dialog will not appear, allowing for custom handling of these actions. When set to false, the standard dialog will be shown as usual. This property can be used to either retrieve the current setting (get) or define its behavior (set).
|
|
20017
19974
|
* Default value: false
|
|
@@ -20223,7 +20180,7 @@ export interface KanbanProperties {
|
|
|
20223
20180
|
*/
|
|
20224
20181
|
taskUserIcon?: boolean;
|
|
20225
20182
|
/**
|
|
20226
|
-
* Specifies the template to use for rendering task text. This property accepts multiple value types:- A string starting with #, which references the id of a
|
|
20183
|
+
* Specifies the template to use for rendering task text. This property accepts multiple value types:- A string starting with #, which references the id of a template element on the page. The contents of this element will be used as the template.- A string containing HTML or template markup, which will be parsed and applied directly to the task text.- A function, which receives the task text (or a template) as input and returns the modified text or template to be used.This property can be both set to define the template for future tasks, or retrieved to access the currently applied template.
|
|
20227
20184
|
* Default value: null
|
|
20228
20185
|
*/
|
|
20229
20186
|
textTemplate?: any;
|
|
@@ -20375,11 +20332,12 @@ export interface Kanban extends BaseElement, KanbanProperties {
|
|
|
20375
20332
|
onCommentUpdate?: ((this: any, ev: Event) => any) | ((this: any, ev: CustomEvent<any>) => any) | null;
|
|
20376
20333
|
/**
|
|
20377
20334
|
* This event is triggered when a task is dropped onto a target element within the DOM during a drag-and-drop operation. It allows developers to handle the completion of a drag action by responding to where the task is released. To prevent the default drop behavior—such as moving the element or initiating a browser action—you can call event.preventDefault() within the event handler. This enables you to implement custom logic for handling dropped tasks, such as updating data models, modifying the UI, or triggering other application-specific actions."
|
|
20378
|
-
* @param event. The custom event. Custom data event was created with: ev.detail(container, data, item, items, originalEvent, previousContainer, target)
|
|
20335
|
+
* @param event. The custom event. Custom data event was created with: ev.detail(container, data, item, items, confirmDrop, originalEvent, previousContainer, target)
|
|
20379
20336
|
* container - the Kanban the dragged task(s) is dropped to
|
|
20380
20337
|
* data - an object with additional drag details
|
|
20381
20338
|
* item - the task that is dragged; if multiple tasks are dragged, this is the task that has been clicked when initiating the drag operation
|
|
20382
20339
|
* items - an array with all dragged tasks
|
|
20340
|
+
* confirmDrop - parameter which you can set to a function. When this is defined, the DROP operation is confirmed once this function is called. Otherwise, the drop is canceled. This feature can be combined with the Kanban's getConfirmDialog(label, content, callbackFn) method or with a custom confirm dialog.
|
|
20383
20341
|
* originalEvent - the original, browser, event that initiates the drag operation
|
|
20384
20342
|
* previousContainer - the Kanban the dragged item(s) is dragged from
|
|
20385
20343
|
* target - the element the dragged tasks are dropped to
|
|
@@ -20512,6 +20470,14 @@ export interface Kanban extends BaseElement, KanbanProperties {
|
|
|
20512
20470
|
* Removes any currently selected items or cards within the Kanban board, ensuring that no items remain selected. This action resets the selection state of the Kanban component.
|
|
20513
20471
|
*/
|
|
20514
20472
|
clearSelection(): void;
|
|
20473
|
+
/**
|
|
20474
|
+
* Create an instance of the Window component which is used as a confirm dialog. It gets 3 arguments, label, content and confirm function.
|
|
20475
|
+
* @param {string} label. The label shown in the header of the window. For example: Confirm move.
|
|
20476
|
+
* @param {string} content. The label shown in the content of the window. For example: Are you sure you want to move this task?
|
|
20477
|
+
* @param {any} confirmFn. The function called when the OK button is clicked.
|
|
20478
|
+
* @returns {any}
|
|
20479
|
+
*/
|
|
20480
|
+
getConfirmDialog(label: string, content: string, confirmFn: any): any;
|
|
20515
20481
|
/**
|
|
20516
20482
|
* Conceals a specific column within a Kanban board, making its contents and tasks temporarily invisible to users without deleting any data. This action helps declutter the board or focus attention on other columns. The hidden column can typically be shown again through board settings or controls.
|
|
20517
20483
|
* @param {number | string} column. The index or dataField of the column to hide
|
|
@@ -21530,6 +21496,11 @@ export interface ListBoxProperties {
|
|
|
21530
21496
|
* Default value: false
|
|
21531
21497
|
*/
|
|
21532
21498
|
rightToLeft?: boolean;
|
|
21499
|
+
/**
|
|
21500
|
+
* Controls whether the select all item is displayed when Checkboxes are enabled.
|
|
21501
|
+
* Default value: false
|
|
21502
|
+
*/
|
|
21503
|
+
selectAll?: boolean;
|
|
21533
21504
|
/**
|
|
21534
21505
|
* Gets or sets the selected indexes. The selected indexes property is an array containing the numerical indexes of the items that are currently selected. Assigning an array of indexes will update the selection to match those items; retrieving this property returns the array of currently selected item indexes.
|
|
21535
21506
|
* Default value:
|
|
@@ -21724,6 +21695,11 @@ export interface ListBox extends BaseElement, ListBoxProperties {
|
|
|
21724
21695
|
* @returns {{label: string, value: string}[]}
|
|
21725
21696
|
*/
|
|
21726
21697
|
getItems(): {label: string, value: string}[];
|
|
21698
|
+
/**
|
|
21699
|
+
* Returns an array of the selected values.
|
|
21700
|
+
* @returns {any[]}
|
|
21701
|
+
*/
|
|
21702
|
+
getSelectedValues(): any[];
|
|
21727
21703
|
/**
|
|
21728
21704
|
* Inserts a new item into the collection at the specified index, shifting existing items at and after that position one place to the right. The index determines the position in the array or list where the new item will be placed.
|
|
21729
21705
|
* @param {number} index. The index where the item must be inserted.
|
|
@@ -27722,7 +27698,7 @@ export interface SchedulerProperties {
|
|
|
27722
27698
|
*/
|
|
27723
27699
|
groupOrientation?: SchedulerGroupOrientation | string;
|
|
27724
27700
|
/**
|
|
27725
|
-
* Enhances customization for group cell headers by allowing you to define how each group cell is rendered within the header section. You can specify one of the following as the template:- 'HTMLTemplateElement': Supply an HTML '' element that will be applied to all group header cells. Within your template, you can use property bindings that correspond to properties of the group cell object. These bindings will be automatically populated with the respective values for each cell.- 'Template ID (String)': Provide the 'id' attribute of an existing HTML '' element. The identified template will be used for rendering all group header cells.- 'Custom Function': Specify a function that will be called for each group cell. The function will receive two parameters: - 'cellContent': A DOM element that acts as a container for the group cell’s content. - 'cellObj': The data object associated with the current group cell.This approach gives you full flexibility to display custom content, styles, and data for group header cells according to your requirements. If you use an HTMLTemplateElement, you can leverage dynamic property bindings that map directly to the properties of each group cell’s data object.
|
|
27701
|
+
* Enhances customization for group cell headers by allowing you to define how each group cell is rendered within the header section. You can specify one of the following as the template:- 'HTMLTemplateElement': Supply an HTML '<template>' element that will be applied to all group header cells. Within your template, you can use property bindings that correspond to properties of the group cell object. These bindings will be automatically populated with the respective values for each cell.- 'Template ID (String)': Provide the 'id' attribute of an existing HTML '<template>' element. The identified template will be used for rendering all group header cells.- 'Custom Function': Specify a function that will be called for each group cell. The function will receive two parameters: - 'cellContent': A DOM element that acts as a container for the group cell’s content. - 'cellObj': The data object associated with the current group cell.This approach gives you full flexibility to display custom content, styles, and data for group header cells according to your requirements. If you use an HTMLTemplateElement, you can leverage dynamic property bindings that map directly to the properties of each group cell’s data object.
|
|
27726
27702
|
* Default value: null
|
|
27727
27703
|
*/
|
|
27728
27704
|
groupTemplate?: any;
|
|
@@ -30379,12 +30355,12 @@ export interface TableProperties {
|
|
|
30379
30355
|
*/
|
|
30380
30356
|
filterOperator?: boolean;
|
|
30381
30357
|
/**
|
|
30382
|
-
* Gets or sets the ID of an HTML
|
|
30358
|
+
* Gets or sets the ID of an HTML <template> element to be used as a custom filter template. This allows you to define and apply your own filter UI by referencing the specified template’s ID.
|
|
30383
30359
|
* Default value: "null"
|
|
30384
30360
|
*/
|
|
30385
30361
|
filterTemplate?: string;
|
|
30386
30362
|
/**
|
|
30387
|
-
* Specifies or retrieves the ID of an HTML '' element whose content will be used to render the footer row(s) of the component. This allows you to define custom footer layouts using template markup and apply them dynamically by referencing the template's ID.
|
|
30363
|
+
* Specifies or retrieves the ID of an HTML '<template>' element whose content will be used to render the footer row(s) of the component. This allows you to define custom footer layouts using template markup and apply them dynamically by referencing the template's ID.
|
|
30388
30364
|
* Default value: "null"
|
|
30389
30365
|
*/
|
|
30390
30366
|
footerRow?: string;
|
package/package.json
CHANGED
package/source/smart.button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI
|
|
2
|
+
/* Smart UI v25.0.0 (2025-11-26)
|
|
3
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,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","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)}});
|