fit-ui 3.1.0 → 3.2.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.
@@ -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.0",
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,278 @@ 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
+ // Functions defined by Fit.Controls.ControlBase
1460
+ /**
1461
+ * Add CSS class to DOMElement representing control.
1462
+ * @function AddCssClass
1463
+ * @param {string} val - CSS class to add.
1464
+ */
1465
+ public AddCssClass(val:string):void;
1466
+ /**
1467
+ * Set callback function used to perform on-the-fly validation against control.
1468
+ * @function AddValidationRule
1469
+ * @param {Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>} validator - Function receiving an instance of the control.
1470
+ A value of False or a non-empty string with an
1471
+ error message must be returned if value is invalid.
1472
+ */
1473
+ public AddValidationRule(validator:Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>):void;
1474
+ /**
1475
+ * Set regular expression used to perform on-the-fly validation against control value, as returned by the Value() function.
1476
+ * @function AddValidationRule
1477
+ * @param {RegExp} validator - Regular expression to validate value against.
1478
+ * @param {string} [errorMessage=undefined] - Optional error message displayed if value validation fails.
1479
+ */
1480
+ public AddValidationRule(validator:RegExp, errorMessage?:string):void;
1481
+ /**
1482
+ * Get/set value indicating whether control is always considered dirty. This
1483
+ comes in handy when programmatically changing a value of a control on behalf
1484
+ of the user. Some applications may choose to only save values from dirty controls.
1485
+ * @function AlwaysDirty
1486
+ * @param {boolean} [val=undefined] - If defined, Always Dirty is enabled/disabled.
1487
+ * @returns boolean
1488
+ */
1489
+ public AlwaysDirty(val?:boolean):boolean;
1490
+ /**
1491
+ * Set flag indicating whether control should post back changes automatically when value is changed.
1492
+ * @function AutoPostBack
1493
+ * @param {boolean} [val=undefined] - If defined, True enables auto post back, False disables it.
1494
+ * @returns boolean
1495
+ */
1496
+ public AutoPostBack(val?:boolean):boolean;
1497
+ /**
1498
+ * Clear control value.
1499
+ * @function Clear
1500
+ */
1501
+ public Clear():void;
1502
+ /**
1503
+ * Get/set value indicating whether control is enabled or disabled.
1504
+ A disabled control's value and state is still included on postback, if part of a form.
1505
+ * @function Enabled
1506
+ * @param {boolean} [val=undefined] - If defined, True enables control (default), False disables control.
1507
+ * @returns boolean
1508
+ */
1509
+ public Enabled(val?:boolean):boolean;
1510
+ /**
1511
+ * Get/set value indicating whether control has focus.
1512
+ Control must be rooted in DOM and be visible for control to gain focus.
1513
+ * @function Focused
1514
+ * @param {boolean} [value=undefined] - If defined, True assigns focus, False removes focus (blur).
1515
+ * @returns boolean
1516
+ */
1517
+ public Focused(value?:boolean):boolean;
1518
+ /**
1519
+ * Check whether CSS class is found on DOMElement representing control.
1520
+ * @function HasCssClass
1521
+ * @param {string} val - CSS class to check for.
1522
+ * @returns boolean
1523
+ */
1524
+ public HasCssClass(val:string):boolean;
1525
+ /**
1526
+ * Get/set control height - returns object with Value and Unit properties.
1527
+ * @function Height
1528
+ * @param {number} [val=undefined] - If defined, control height is updated to specified value. A value of -1 resets control height.
1529
+ * @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.
1530
+ * @returns Fit.TypeDefs.CssValue
1531
+ */
1532
+ 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;
1533
+ /**
1534
+ * Get value indicating whether user has changed control value.
1535
+ * @function IsDirty
1536
+ * @returns boolean
1537
+ */
1538
+ public IsDirty():boolean;
1539
+ /**
1540
+ * Get value indicating whether control value is valid.
1541
+ Control value is considered invalid if control is required, but no value is set,
1542
+ or if control value does not match regular expression set using SetValidationExpression(..).
1543
+ * @function IsValid
1544
+ * @returns boolean
1545
+ */
1546
+ public IsValid():boolean;
1547
+ /**
1548
+ * Get/set value indicating whether control initially appears as valid, even
1549
+ though it is not. It will appear invalid once the user touches the control,
1550
+ or when control value is validated using Fit.Controls.ValidateAll(..).
1551
+ * @function LazyValidation
1552
+ * @param {boolean} [val=undefined] - If defined, Lazy Validation is enabled/disabled.
1553
+ * @returns boolean
1554
+ */
1555
+ public LazyValidation(val?:boolean):boolean;
1556
+ /**
1557
+ * Register OnBlur event handler which is invoked when control loses focus.
1558
+ * @function OnBlur
1559
+ * @param {Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>} cb - Event handler function which accepts Sender (ControlBase).
1560
+ */
1561
+ public OnBlur(cb:Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>):void;
1562
+ /**
1563
+ * Register OnChange event handler which is invoked when control value is changed either programmatically or by user.
1564
+ * @function OnChange
1565
+ * @param {Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>} cb - Event handler function which accepts Sender (ControlBase).
1566
+ */
1567
+ public OnChange(cb:Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>):void;
1568
+ /**
1569
+ * Register OnFocus event handler which is invoked when control gains focus.
1570
+ * @function OnFocus
1571
+ * @param {Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>} cb - Event handler function which accepts Sender (ControlBase).
1572
+ */
1573
+ public OnFocus(cb:Fit.Controls.ControlBaseTypeDefs.BaseEvent<this>):void;
1574
+ /**
1575
+ * Remove all validation rules.
1576
+ * @function RemoveAllValidationRules
1577
+ */
1578
+ public RemoveAllValidationRules():void;
1579
+ /**
1580
+ * Remove CSS class from DOMElement representing control.
1581
+ * @function RemoveCssClass
1582
+ * @param {string} val - CSS class to remove.
1583
+ */
1584
+ public RemoveCssClass(val:string):void;
1585
+ /**
1586
+ * Remove validation function used to perform on-the-fly validation against control.
1587
+ * @function RemoveValidationRule
1588
+ * @param {Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>} validator - Validation function registered using AddValidationRule(..).
1589
+ */
1590
+ public RemoveValidationRule(validator:Fit.Controls.ControlBaseTypeDefs.ValidationCallback<this>):void;
1591
+ /**
1592
+ * Remove regular expression used to perform on-the-fly validation against control value.
1593
+ * @function RemoveValidationRule
1594
+ * @param {RegExp} validator - Regular expression registered using AddValidationRule(..).
1595
+ */
1596
+ public RemoveValidationRule(validator:RegExp):void;
1597
+ /**
1598
+ * Get/set value indicating whether control is required to be set.
1599
+ * @function Required
1600
+ * @param {boolean} [val=undefined] - If defined, control required feature is enabled/disabled.
1601
+ * @returns boolean
1602
+ */
1603
+ public Required(val?:boolean):boolean;
1604
+ /**
1605
+ * Get/set scope to which control belongs - this is used to validate multiple
1606
+ controls at once using Fit.Controls.ValidateAll(scope) or Fit.Controls.DirtyCheckAll(scope).
1607
+ * @function Scope
1608
+ * @param {string} [val=undefined] - If defined, control scope is updated.
1609
+ * @returns string
1610
+ */
1611
+ public Scope(val?:string):string;
1612
+ /**
1613
+ * DEPRECATED! Please use AddValidationRule(..) instead.
1614
+ Set callback function used to perform on-the-fly validation against control value.
1615
+ * @function SetValidationCallback
1616
+ * @param {Function | null} cb - Function receiving control value - must return True if value is valid, otherwise False.
1617
+ * @param {string} [errorMsg=undefined] - If defined, specified error message is displayed when user clicks or hovers validation error indicator.
1618
+ */
1619
+ public SetValidationCallback(cb:Function | null, errorMsg?:string):void;
1620
+ /**
1621
+ * DEPRECATED! Please use AddValidationRule(..) instead.
1622
+ Set regular expression used to perform on-the-fly validation against control value.
1623
+ * @function SetValidationExpression
1624
+ * @param {RegExp | null} regEx - Regular expression to validate against.
1625
+ * @param {string} [errorMsg=undefined] - If defined, specified error message is displayed when user clicks or hovers validation error indicator.
1626
+ */
1627
+ public SetValidationExpression(regEx:RegExp | null, errorMsg?:string):void;
1628
+ /**
1629
+ * DEPRECATED! Please use AddValidationRule(..) instead.
1630
+ Set callback function used to perform on-the-fly validation against control value.
1631
+ * @function SetValidationHandler
1632
+ * @param {Function | null} cb - Function receiving an instance of the control and its value.
1633
+ An error message string must be returned if value is invalid,
1634
+ otherwise Null or an empty string if the value is valid.
1635
+ */
1636
+ public SetValidationHandler(cb:Function | null):void;
1637
+ /**
1638
+ * Get/set value indicating whether control immediately shows and
1639
+ updates its validation error as the user changes the control value.
1640
+ * @function ShowValidationErrorsOnChange
1641
+ * @param {boolean} [val=undefined] - If defined, True enables feature, False disables it.
1642
+ * @returns boolean
1643
+ */
1644
+ public ShowValidationErrorsOnChange(val?:boolean):boolean;
1645
+ /**
1646
+ * Get/set value as if it was changed by the user. Contrary to Value(..), this function will never reset the dirty state.
1647
+ Restrictions/filtering/modifications may be enforced just as the UI control might do, e.g. prevent the use of certain
1648
+ characters, or completely ignore input if not allowed. It may also allow invalid values such as a partially entered date
1649
+ value. The intention with UserValue(..) is to mimic the behaviour of what the user can do with the user interface control.
1650
+ For picker controls the value format is equivalent to the one dictated by the Value(..) function.
1651
+ * @function UserValue
1652
+ * @param {string} [val=undefined] - If defined, value is inserted into control.
1653
+ * @returns string
1654
+ */
1655
+ public UserValue(val?:string):string;
1656
+ /**
1657
+ * Get/set control value.
1658
+ For controls supporting multiple selections: Set value by providing a string in one the following formats:
1659
+ title1=val1[;title2=val2[;title3=val3]] or val1[;val2[;val3]].
1660
+ If Title or Value contains reserved characters (semicolon or equality sign), these most be URIEncoded.
1661
+ Selected items are returned in the first format described, also with reserved characters URIEncoded.
1662
+ Providing a new value to this function results in OnChange being fired.
1663
+ * @function Value
1664
+ * @param {string} [val=undefined] - If defined, value is inserted into control.
1665
+ * @param {boolean} [preserveDirtyState=false] - If defined, True prevents dirty state from being reset, False (default) resets the dirty state.
1666
+ If dirty state is reset (default), the control value will be compared against the value passed,
1667
+ to determine whether it has been changed by the user or not, when IsDirty() is called.
1668
+ * @returns string
1669
+ */
1670
+ public Value(val?:string, preserveDirtyState?:boolean):string;
1671
+ /**
1672
+ * Get/set value indicating whether control is visible.
1673
+ * @function Visible
1674
+ * @param {boolean} [val=undefined] - If defined, control visibility is updated.
1675
+ * @returns boolean
1676
+ */
1677
+ public Visible(val?:boolean):boolean;
1678
+ /**
1679
+ * Get/set control width - returns object with Value and Unit properties.
1680
+ * @function Width
1681
+ * @param {number} [val=undefined] - If defined, control width is updated to specified value. A value of -1 resets control width.
1682
+ * @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.
1683
+ * @returns Fit.TypeDefs.CssValue
1684
+ */
1685
+ 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;
1686
+ // Functions defined by Fit.Controls.Component
1687
+ /**
1688
+ * Destroys control to free up memory.
1689
+ Make sure to call Dispose() on Component which can be done like so:
1690
+ this.Dispose = Fit.Core.CreateOverride(this.Dispose, function()
1691
+ {
1692
+      // Add control specific dispose logic here
1693
+      base(); // Call Dispose on Component
1694
+ });.
1695
+ * @function Dispose
1696
+ */
1697
+ public Dispose():void;
1698
+ /**
1699
+ * Get DOMElement representing control.
1700
+ * @function GetDomElement
1701
+ * @returns HTMLElement
1702
+ */
1703
+ public GetDomElement():HTMLElement;
1704
+ /**
1705
+ * Get unique Control ID.
1706
+ * @function GetId
1707
+ * @returns string
1708
+ */
1709
+ public GetId():string;
1710
+ /**
1711
+ * Render control, either inline or to element specified.
1712
+ * @function Render
1713
+ * @param {HTMLElement} [toElement=undefined] - If defined, control is rendered to this element.
1714
+ */
1715
+ public Render(toElement?:HTMLElement):void;
1716
+ }
1717
+ /**
1436
1718
  * Class from which all UI components extend.
1437
1719
  * @class [Fit.Controls.Component Component]
1438
1720
  */