fit-ui 3.1.0 → 3.2.1

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.
@@ -1,137 +1,137 @@
1
- /**
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
-
6
- // This file contains style definitions that can be used by CKEditor plugins.
7
- //
8
- // The most common use for it is the "stylescombo" plugin which shows the Styles drop-down
9
- // list containing all styles in the editor toolbar. Other plugins, like
10
- // the "div" plugin, use a subset of the styles for their features.
11
- //
12
- // If you do not have plugins that depend on this file in your editor build, you can simply
13
- // ignore it. Otherwise it is strongly recommended to customize this file to match your
14
- // website requirements and design properly.
15
- //
16
- // For more information refer to: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_styles.html#style-rules
17
-
18
- CKEDITOR.stylesSet.add( 'default', [
19
- /* Block styles */
20
-
21
- // These styles are already available in the "Format" drop-down list ("format" plugin),
22
- // so they are not needed here by default. You may enable them to avoid
23
- // placing the "Format" combo in the toolbar, maintaining the same features.
24
- /*
25
- { name: 'Paragraph', element: 'p' },
26
- { name: 'Heading 1', element: 'h1' },
27
- { name: 'Heading 2', element: 'h2' },
28
- { name: 'Heading 3', element: 'h3' },
29
- { name: 'Heading 4', element: 'h4' },
30
- { name: 'Heading 5', element: 'h5' },
31
- { name: 'Heading 6', element: 'h6' },
32
- { name: 'Preformatted Text',element: 'pre' },
33
- { name: 'Address', element: 'address' },
34
- */
35
-
36
- { name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
37
- { name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
38
- {
39
- name: 'Special Container',
40
- element: 'div',
41
- styles: {
42
- padding: '5px 10px',
43
- background: '#eee',
44
- border: '1px solid #ccc'
45
- }
46
- },
47
-
48
- /* Inline styles */
49
-
50
- // These are core styles available as toolbar buttons. You may opt enabling
51
- // some of them in the Styles drop-down list, removing them from the toolbar.
52
- // (This requires the "stylescombo" plugin.)
53
- /*
54
- { name: 'Strong', element: 'strong', overrides: 'b' },
55
- { name: 'Emphasis', element: 'em' , overrides: 'i' },
56
- { name: 'Underline', element: 'u' },
57
- { name: 'Strikethrough', element: 'strike' },
58
- { name: 'Subscript', element: 'sub' },
59
- { name: 'Superscript', element: 'sup' },
60
- */
61
-
62
- { name: 'Marker', element: 'span', attributes: { 'class': 'marker' } },
63
-
64
- { name: 'Big', element: 'big' },
65
- { name: 'Small', element: 'small' },
66
- { name: 'Typewriter', element: 'tt' },
67
-
68
- { name: 'Computer Code', element: 'code' },
69
- { name: 'Keyboard Phrase', element: 'kbd' },
70
- { name: 'Sample Text', element: 'samp' },
71
- { name: 'Variable', element: 'var' },
72
-
73
- { name: 'Deleted Text', element: 'del' },
74
- { name: 'Inserted Text', element: 'ins' },
75
-
76
- { name: 'Cited Work', element: 'cite' },
77
- { name: 'Inline Quotation', element: 'q' },
78
-
79
- { name: 'Language: RTL', element: 'span', attributes: { 'dir': 'rtl' } },
80
- { name: 'Language: LTR', element: 'span', attributes: { 'dir': 'ltr' } },
81
-
82
- /* Object styles */
83
-
84
- {
85
- name: 'Styled Image (left)',
86
- element: 'img',
87
- attributes: { 'class': 'left' }
88
- },
89
-
90
- {
91
- name: 'Styled Image (right)',
92
- element: 'img',
93
- attributes: { 'class': 'right' }
94
- },
95
-
96
- {
97
- name: 'Compact Table',
98
- element: 'table',
99
- attributes: {
100
- cellpadding: '5',
101
- cellspacing: '0',
102
- border: '1',
103
- bordercolor: '#ccc'
104
- },
105
- styles: {
106
- 'border-collapse': 'collapse'
107
- }
108
- },
109
-
110
- { name: 'Borderless Table', element: 'table', styles: { 'border-style': 'hidden', 'background-color': '#E6E6FA' } },
111
- { name: 'Square Bulleted List', element: 'ul', styles: { 'list-style-type': 'square' } },
112
-
113
- /* Widget styles */
114
-
115
- { name: 'Clean Image', type: 'widget', widget: 'image', attributes: { 'class': 'image-clean' } },
116
- { name: 'Grayscale Image', type: 'widget', widget: 'image', attributes: { 'class': 'image-grayscale' } },
117
-
118
- { name: 'Featured Snippet', type: 'widget', widget: 'codeSnippet', attributes: { 'class': 'code-featured' } },
119
-
120
- { name: 'Featured Formula', type: 'widget', widget: 'mathjax', attributes: { 'class': 'math-featured' } },
121
-
122
- { name: '240p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-240p' }, group: 'size' },
123
- { name: '360p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-360p' }, group: 'size' },
124
- { name: '480p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-480p' }, group: 'size' },
125
- { name: '720p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-720p' }, group: 'size' },
126
- { name: '1080p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-1080p' }, group: 'size' },
127
-
128
- // Adding space after the style name is an intended workaround. For now, there
129
- // is no option to create two styles with the same name for different widget types. See https://dev.ckeditor.com/ticket/16664.
130
- { name: '240p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-240p' }, group: 'size' },
131
- { name: '360p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-360p' }, group: 'size' },
132
- { name: '480p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-480p' }, group: 'size' },
133
- { name: '720p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-720p' }, group: 'size' },
134
- { name: '1080p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-1080p' }, group: 'size' }
135
-
136
- ] );
137
-
1
+ /**
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ // This file contains style definitions that can be used by CKEditor plugins.
7
+ //
8
+ // The most common use for it is the "stylescombo" plugin which shows the Styles drop-down
9
+ // list containing all styles in the editor toolbar. Other plugins, like
10
+ // the "div" plugin, use a subset of the styles for their features.
11
+ //
12
+ // If you do not have plugins that depend on this file in your editor build, you can simply
13
+ // ignore it. Otherwise it is strongly recommended to customize this file to match your
14
+ // website requirements and design properly.
15
+ //
16
+ // For more information refer to: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_styles.html#style-rules
17
+
18
+ CKEDITOR.stylesSet.add( 'default', [
19
+ /* Block styles */
20
+
21
+ // These styles are already available in the "Format" drop-down list ("format" plugin),
22
+ // so they are not needed here by default. You may enable them to avoid
23
+ // placing the "Format" combo in the toolbar, maintaining the same features.
24
+ /*
25
+ { name: 'Paragraph', element: 'p' },
26
+ { name: 'Heading 1', element: 'h1' },
27
+ { name: 'Heading 2', element: 'h2' },
28
+ { name: 'Heading 3', element: 'h3' },
29
+ { name: 'Heading 4', element: 'h4' },
30
+ { name: 'Heading 5', element: 'h5' },
31
+ { name: 'Heading 6', element: 'h6' },
32
+ { name: 'Preformatted Text',element: 'pre' },
33
+ { name: 'Address', element: 'address' },
34
+ */
35
+
36
+ { name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
37
+ { name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
38
+ {
39
+ name: 'Special Container',
40
+ element: 'div',
41
+ styles: {
42
+ padding: '5px 10px',
43
+ background: '#eee',
44
+ border: '1px solid #ccc'
45
+ }
46
+ },
47
+
48
+ /* Inline styles */
49
+
50
+ // These are core styles available as toolbar buttons. You may opt enabling
51
+ // some of them in the Styles drop-down list, removing them from the toolbar.
52
+ // (This requires the "stylescombo" plugin.)
53
+ /*
54
+ { name: 'Strong', element: 'strong', overrides: 'b' },
55
+ { name: 'Emphasis', element: 'em' , overrides: 'i' },
56
+ { name: 'Underline', element: 'u' },
57
+ { name: 'Strikethrough', element: 'strike' },
58
+ { name: 'Subscript', element: 'sub' },
59
+ { name: 'Superscript', element: 'sup' },
60
+ */
61
+
62
+ { name: 'Marker', element: 'span', attributes: { 'class': 'marker' } },
63
+
64
+ { name: 'Big', element: 'big' },
65
+ { name: 'Small', element: 'small' },
66
+ { name: 'Typewriter', element: 'tt' },
67
+
68
+ { name: 'Computer Code', element: 'code' },
69
+ { name: 'Keyboard Phrase', element: 'kbd' },
70
+ { name: 'Sample Text', element: 'samp' },
71
+ { name: 'Variable', element: 'var' },
72
+
73
+ { name: 'Deleted Text', element: 'del' },
74
+ { name: 'Inserted Text', element: 'ins' },
75
+
76
+ { name: 'Cited Work', element: 'cite' },
77
+ { name: 'Inline Quotation', element: 'q' },
78
+
79
+ { name: 'Language: RTL', element: 'span', attributes: { 'dir': 'rtl' } },
80
+ { name: 'Language: LTR', element: 'span', attributes: { 'dir': 'ltr' } },
81
+
82
+ /* Object styles */
83
+
84
+ {
85
+ name: 'Styled Image (left)',
86
+ element: 'img',
87
+ attributes: { 'class': 'left' }
88
+ },
89
+
90
+ {
91
+ name: 'Styled Image (right)',
92
+ element: 'img',
93
+ attributes: { 'class': 'right' }
94
+ },
95
+
96
+ {
97
+ name: 'Compact Table',
98
+ element: 'table',
99
+ attributes: {
100
+ cellpadding: '5',
101
+ cellspacing: '0',
102
+ border: '1',
103
+ bordercolor: '#ccc'
104
+ },
105
+ styles: {
106
+ 'border-collapse': 'collapse'
107
+ }
108
+ },
109
+
110
+ { name: 'Borderless Table', element: 'table', styles: { 'border-style': 'hidden', 'background-color': '#E6E6FA' } },
111
+ { name: 'Square Bulleted List', element: 'ul', styles: { 'list-style-type': 'square' } },
112
+
113
+ /* Widget styles */
114
+
115
+ { name: 'Clean Image', type: 'widget', widget: 'image', attributes: { 'class': 'image-clean' } },
116
+ { name: 'Grayscale Image', type: 'widget', widget: 'image', attributes: { 'class': 'image-grayscale' } },
117
+
118
+ { name: 'Featured Snippet', type: 'widget', widget: 'codeSnippet', attributes: { 'class': 'code-featured' } },
119
+
120
+ { name: 'Featured Formula', type: 'widget', widget: 'mathjax', attributes: { 'class': 'math-featured' } },
121
+
122
+ { name: '240p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-240p' }, group: 'size' },
123
+ { name: '360p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-360p' }, group: 'size' },
124
+ { name: '480p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-480p' }, group: 'size' },
125
+ { name: '720p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-720p' }, group: 'size' },
126
+ { name: '1080p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-1080p' }, group: 'size' },
127
+
128
+ // Adding space after the style name is an intended workaround. For now, there
129
+ // is no option to create two styles with the same name for different widget types. See https://dev.ckeditor.com/ticket/16664.
130
+ { name: '240p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-240p' }, group: 'size' },
131
+ { name: '360p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-360p' }, group: 'size' },
132
+ { name: '480p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-480p' }, group: 'size' },
133
+ { name: '720p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-720p' }, group: 'size' },
134
+ { name: '1080p ', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-1080p' }, group: 'size' }
135
+
136
+ ] );
137
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fit-ui",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "title": "Fit.UI",
5
5
  "description": "Object Oriented framework for building rich User Interfaces",
6
6
  "main": "dist/Fit.UI.js",
package/types/index.d.ts CHANGED
@@ -896,6 +896,16 @@ declare namespace Fit
896
896
  {
897
897
  // Functions defined by Fit.Color
898
898
  /**
899
+ * Get "black" or "white" depending on which is best suited in combination with specified color.
900
+ * @function GetContrastColor
901
+ * @static
902
+ * @param {string} hex - HEX color string, e.g. #C0C0C0 (hash symbol is optional).
903
+ * @param {number} [threshold=undefined] - Returns "black" when brightness is above threshold, "white" otherwise.
904
+ 0 = all black, 255 = all white. Value defaults to 128.
905
+ * @returns string
906
+ */
907
+ public static GetContrastColor(hex:string, threshold?:number):string;
908
+ /**
899
909
  * Convert HEX color string into RGB color string.
900
910
  * @function HexToRgb
901
911
  * @static
@@ -1433,6 +1443,285 @@ declare namespace Fit
1433
1443
  public Render(toElement?:HTMLElement):void;
1434
1444
  }
1435
1445
  /**
1446
+ * ColorPicker control which allows for color selection.
1447
+ Extending from Fit.Controls.ControlBase.
1448
+ * @class [Fit.Controls.ColorPicker ColorPicker]
1449
+ */
1450
+ class ColorPicker
1451
+ {
1452
+ // Functions defined by Fit.Controls.ColorPicker
1453
+ /**
1454
+ * Create instance of ColorPicker control.
1455
+ * @function ColorPicker
1456
+ * @param {string} [ctlId=undefined] - Unique control ID that can be used to access control using Fit.Controls.Find(..).
1457
+ */
1458
+ constructor(ctlId?:string);
1459
+ /**
1460
+ * Get/set value indicating whether control should show HEX color code (default) or not.
1461
+ * @function ShowValue
1462
+ * @param {boolean} [val=undefined] - If defined, True shows label with HEX color code, False hides it.
1463
+ * @returns boolean
1464
+ */
1465
+ public ShowValue(val?:boolean):boolean;
1466
+ // Functions defined by Fit.Controls.ControlBase
1467
+ /**
1468
+ * Add CSS class to DOMElement representing control.
1469
+ * @function AddCssClass
1470
+ * @param {string} val - CSS class to add.
1471
+ */
1472
+ public AddCssClass(val:string):void;
1473
+ /**
1474
+ * Set callback function used to perform on-the-fly validation against control.
1475
+ * @function AddValidationRule
1476
+ * @param {Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>} validator - Function receiving an instance of the control.
1477
+ A value of False or a non-empty string with an
1478
+ error message must be returned if value is invalid.
1479
+ */
1480
+ public AddValidationRule(validator:Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>):void;
1481
+ /**
1482
+ * Set regular expression used to perform on-the-fly validation against control value, as returned by the Value() function.
1483
+ * @function AddValidationRule
1484
+ * @param {RegExp} validator - Regular expression to validate value against.
1485
+ * @param {string} [errorMessage=undefined] - Optional error message displayed if value validation fails.
1486
+ */
1487
+ public AddValidationRule(validator:RegExp, errorMessage?:string):void;
1488
+ /**
1489
+ * Get/set value indicating whether control is always considered dirty. This
1490
+ comes in handy when programmatically changing a value of a control on behalf
1491
+ of the user. Some applications may choose to only save values from dirty controls.
1492
+ * @function AlwaysDirty
1493
+ * @param {boolean} [val=undefined] - If defined, Always Dirty is enabled/disabled.
1494
+ * @returns boolean
1495
+ */
1496
+ public AlwaysDirty(val?:boolean):boolean;
1497
+ /**
1498
+ * Set flag indicating whether control should post back changes automatically when value is changed.
1499
+ * @function AutoPostBack
1500
+ * @param {boolean} [val=undefined] - If defined, True enables auto post back, False disables it.
1501
+ * @returns boolean
1502
+ */
1503
+ public AutoPostBack(val?:boolean):boolean;
1504
+ /**
1505
+ * Clear control value.
1506
+ * @function Clear
1507
+ */
1508
+ public Clear():void;
1509
+ /**
1510
+ * Get/set value indicating whether control is enabled or disabled.
1511
+ A disabled control's value and state is still included on postback, if part of a form.
1512
+ * @function Enabled
1513
+ * @param {boolean} [val=undefined] - If defined, True enables control (default), False disables control.
1514
+ * @returns boolean
1515
+ */
1516
+ public Enabled(val?:boolean):boolean;
1517
+ /**
1518
+ * Get/set value indicating whether control has focus.
1519
+ Control must be rooted in DOM and be visible for control to gain focus.
1520
+ * @function Focused
1521
+ * @param {boolean} [value=undefined] - If defined, True assigns focus, False removes focus (blur).
1522
+ * @returns boolean
1523
+ */
1524
+ public Focused(value?:boolean):boolean;
1525
+ /**
1526
+ * Check whether CSS class is found on DOMElement representing control.
1527
+ * @function HasCssClass
1528
+ * @param {string} val - CSS class to check for.
1529
+ * @returns boolean
1530
+ */
1531
+ public HasCssClass(val:string):boolean;
1532
+ /**
1533
+ * Get/set control height - returns object with Value and Unit properties.
1534
+ * @function Height
1535
+ * @param {number} [val=undefined] - If defined, control height is updated to specified value. A value of -1 resets control height.
1536
+ * @param {Fit.TypeDefs.CssUnit | "%" | "ch" | "cm" | "em" | "ex" | "in" | "mm" | "pc" | "pt" | "px" | "rem" | "vh" | "vmax" | "vmin" | "vw"} [unit=px] - If defined, control height is updated to specified CSS unit.
1537
+ * @returns Fit.TypeDefs.CssValue
1538
+ */
1539
+ public Height(val?:number, unit?:Fit.TypeDefs.CssUnit | "%" | "ch" | "cm" | "em" | "ex" | "in" | "mm" | "pc" | "pt" | "px" | "rem" | "vh" | "vmax" | "vmin" | "vw"):Fit.TypeDefs.CssValue;
1540
+ /**
1541
+ * Get value indicating whether user has changed control value.
1542
+ * @function IsDirty
1543
+ * @returns boolean
1544
+ */
1545
+ public IsDirty():boolean;
1546
+ /**
1547
+ * Get value indicating whether control value is valid.
1548
+ Control value is considered invalid if control is required, but no value is set,
1549
+ or if control value does not match regular expression set using SetValidationExpression(..).
1550
+ * @function IsValid
1551
+ * @returns boolean
1552
+ */
1553
+ public IsValid():boolean;
1554
+ /**
1555
+ * Get/set value indicating whether control initially appears as valid, even
1556
+ though it is not. It will appear invalid once the user touches the control,
1557
+ or when control value is validated using Fit.Controls.ValidateAll(..).
1558
+ * @function LazyValidation
1559
+ * @param {boolean} [val=undefined] - If defined, Lazy Validation is enabled/disabled.
1560
+ * @returns boolean
1561
+ */
1562
+ public LazyValidation(val?:boolean):boolean;
1563
+ /**
1564
+ * Register OnBlur event handler which is invoked when control loses focus.
1565
+ * @function OnBlur
1566
+ * @param {Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>} cb - Event handler function which accepts Sender (ControlBase).
1567
+ */
1568
+ public OnBlur(cb:Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>):void;
1569
+ /**
1570
+ * Register OnChange event handler which is invoked when control value is changed either programmatically or by user.
1571
+ * @function OnChange
1572
+ * @param {Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>} cb - Event handler function which accepts Sender (ControlBase).
1573
+ */
1574
+ public OnChange(cb:Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>):void;
1575
+ /**
1576
+ * Register OnFocus event handler which is invoked when control gains focus.
1577
+ * @function OnFocus
1578
+ * @param {Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>} cb - Event handler function which accepts Sender (ControlBase).
1579
+ */
1580
+ public OnFocus(cb:Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>):void;
1581
+ /**
1582
+ * Remove all validation rules.
1583
+ * @function RemoveAllValidationRules
1584
+ */
1585
+ public RemoveAllValidationRules():void;
1586
+ /**
1587
+ * Remove CSS class from DOMElement representing control.
1588
+ * @function RemoveCssClass
1589
+ * @param {string} val - CSS class to remove.
1590
+ */
1591
+ public RemoveCssClass(val:string):void;
1592
+ /**
1593
+ * Remove validation function used to perform on-the-fly validation against control.
1594
+ * @function RemoveValidationRule
1595
+ * @param {Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>} validator - Validation function registered using AddValidationRule(..).
1596
+ */
1597
+ public RemoveValidationRule(validator:Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>):void;
1598
+ /**
1599
+ * Remove regular expression used to perform on-the-fly validation against control value.
1600
+ * @function RemoveValidationRule
1601
+ * @param {RegExp} validator - Regular expression registered using AddValidationRule(..).
1602
+ */
1603
+ public RemoveValidationRule(validator:RegExp):void;
1604
+ /**
1605
+ * Get/set value indicating whether control is required to be set.
1606
+ * @function Required
1607
+ * @param {boolean} [val=undefined] - If defined, control required feature is enabled/disabled.
1608
+ * @returns boolean
1609
+ */
1610
+ public Required(val?:boolean):boolean;
1611
+ /**
1612
+ * Get/set scope to which control belongs - this is used to validate multiple
1613
+ controls at once using Fit.Controls.ValidateAll(scope) or Fit.Controls.DirtyCheckAll(scope).
1614
+ * @function Scope
1615
+ * @param {string} [val=undefined] - If defined, control scope is updated.
1616
+ * @returns string
1617
+ */
1618
+ public Scope(val?:string):string;
1619
+ /**
1620
+ * DEPRECATED! Please use AddValidationRule(..) instead.
1621
+ Set callback function used to perform on-the-fly validation against control value.
1622
+ * @function SetValidationCallback
1623
+ * @param {Function | null} cb - Function receiving control value - must return True if value is valid, otherwise False.
1624
+ * @param {string} [errorMsg=undefined] - If defined, specified error message is displayed when user clicks or hovers validation error indicator.
1625
+ */
1626
+ public SetValidationCallback(cb:Function | null, errorMsg?:string):void;
1627
+ /**
1628
+ * DEPRECATED! Please use AddValidationRule(..) instead.
1629
+ Set regular expression used to perform on-the-fly validation against control value.
1630
+ * @function SetValidationExpression
1631
+ * @param {RegExp | null} regEx - Regular expression to validate against.
1632
+ * @param {string} [errorMsg=undefined] - If defined, specified error message is displayed when user clicks or hovers validation error indicator.
1633
+ */
1634
+ public SetValidationExpression(regEx:RegExp | null, errorMsg?:string):void;
1635
+ /**
1636
+ * DEPRECATED! Please use AddValidationRule(..) instead.
1637
+ Set callback function used to perform on-the-fly validation against control value.
1638
+ * @function SetValidationHandler
1639
+ * @param {Function | null} cb - Function receiving an instance of the control and its value.
1640
+ An error message string must be returned if value is invalid,
1641
+ otherwise Null or an empty string if the value is valid.
1642
+ */
1643
+ public SetValidationHandler(cb:Function | null):void;
1644
+ /**
1645
+ * Get/set value indicating whether control immediately shows and
1646
+ updates its validation error as the user changes the control value.
1647
+ * @function ShowValidationErrorsOnChange
1648
+ * @param {boolean} [val=undefined] - If defined, True enables feature, False disables it.
1649
+ * @returns boolean
1650
+ */
1651
+ public ShowValidationErrorsOnChange(val?:boolean):boolean;
1652
+ /**
1653
+ * Get/set value as if it was changed by the user. Contrary to Value(..), this function will never reset the dirty state.
1654
+ Restrictions/filtering/modifications may be enforced just as the UI control might do, e.g. prevent the use of certain
1655
+ characters, or completely ignore input if not allowed. It may also allow invalid values such as a partially entered date
1656
+ value. The intention with UserValue(..) is to mimic the behaviour of what the user can do with the user interface control.
1657
+ For picker controls the value format is equivalent to the one dictated by the Value(..) function.
1658
+ * @function UserValue
1659
+ * @param {string} [val=undefined] - If defined, value is inserted into control.
1660
+ * @returns string
1661
+ */
1662
+ public UserValue(val?:string):string;
1663
+ /**
1664
+ * Get/set control value.
1665
+ For controls supporting multiple selections: Set value by providing a string in one the following formats:
1666
+ title1=val1[;title2=val2[;title3=val3]] or val1[;val2[;val3]].
1667
+ If Title or Value contains reserved characters (semicolon or equality sign), these most be URIEncoded.
1668
+ Selected items are returned in the first format described, also with reserved characters URIEncoded.
1669
+ Providing a new value to this function results in OnChange being fired.
1670
+ * @function Value
1671
+ * @param {string} [val=undefined] - If defined, value is inserted into control.
1672
+ * @param {boolean} [preserveDirtyState=false] - If defined, True prevents dirty state from being reset, False (default) resets the dirty state.
1673
+ If dirty state is reset (default), the control value will be compared against the value passed,
1674
+ to determine whether it has been changed by the user or not, when IsDirty() is called.
1675
+ * @returns string
1676
+ */
1677
+ public Value(val?:string, preserveDirtyState?:boolean):string;
1678
+ /**
1679
+ * Get/set value indicating whether control is visible.
1680
+ * @function Visible
1681
+ * @param {boolean} [val=undefined] - If defined, control visibility is updated.
1682
+ * @returns boolean
1683
+ */
1684
+ public Visible(val?:boolean):boolean;
1685
+ /**
1686
+ * Get/set control width - returns object with Value and Unit properties.
1687
+ * @function Width
1688
+ * @param {number} [val=undefined] - If defined, control width is updated to specified value. A value of -1 resets control width.
1689
+ * @param {Fit.TypeDefs.CssUnit | "%" | "ch" | "cm" | "em" | "ex" | "in" | "mm" | "pc" | "pt" | "px" | "rem" | "vh" | "vmax" | "vmin" | "vw"} [unit=px] - If defined, control width is updated to specified CSS unit.
1690
+ * @returns Fit.TypeDefs.CssValue
1691
+ */
1692
+ public Width(val?:number, unit?:Fit.TypeDefs.CssUnit | "%" | "ch" | "cm" | "em" | "ex" | "in" | "mm" | "pc" | "pt" | "px" | "rem" | "vh" | "vmax" | "vmin" | "vw"):Fit.TypeDefs.CssValue;
1693
+ // Functions defined by Fit.Controls.Component
1694
+ /**
1695
+ * Destroys control to free up memory.
1696
+ Make sure to call Dispose() on Component which can be done like so:
1697
+ this.Dispose = Fit.Core.CreateOverride(this.Dispose, function()
1698
+ {
1699
+      // Add control specific dispose logic here
1700
+      base(); // Call Dispose on Component
1701
+ });.
1702
+ * @function Dispose
1703
+ */
1704
+ public Dispose():void;
1705
+ /**
1706
+ * Get DOMElement representing control.
1707
+ * @function GetDomElement
1708
+ * @returns HTMLElement
1709
+ */
1710
+ public GetDomElement():HTMLElement;
1711
+ /**
1712
+ * Get unique Control ID.
1713
+ * @function GetId
1714
+ * @returns string
1715
+ */
1716
+ public GetId():string;
1717
+ /**
1718
+ * Render control, either inline or to element specified.
1719
+ * @function Render
1720
+ * @param {HTMLElement} [toElement=undefined] - If defined, control is rendered to this element.
1721
+ */
1722
+ public Render(toElement?:HTMLElement):void;
1723
+ }
1724
+ /**
1436
1725
  * Class from which all UI components extend.
1437
1726
  * @class [Fit.Controls.Component Component]
1438
1727
  */