@componyx/ui 0.0.0-stage → 1.0.3
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/AppSkin/AppSkin.css +1268 -0
- package/AppSkin/AppSkin.js +2748 -0
- package/AppSkin/Themes/Default.css +241 -0
- package/Base/Base.js +3407 -0
- package/Base/ComponentIcons.css +66 -0
- package/Base/Font/ComponentIcons.woff +0 -0
- package/Base/Font/UI.woff +0 -0
- package/Base/Library.js +8432 -0
- package/Base/NavigationManager.js +462 -0
- package/Base/ResponsiveTemplates.js +371 -0
- package/Base/Sanitizer.js +288 -0
- package/Base/Themes/Default.css +255 -0
- package/Base/UI.css +618 -0
- package/Base/UIResourcePath.js +6 -0
- package/Bindary/Bindary.js +2011 -0
- package/Bindary/Modules/Connection.js +216 -0
- package/Bindary/Modules/Core.js +854 -0
- package/Bindary/Modules/DataUpdater.js +351 -0
- package/Bindary/Modules/ExpressionEngine.js +347 -0
- package/Bindary/Modules/ProxyManager.js +482 -0
- package/Bindary/Modules/Renderer.js +605 -0
- package/Bindary/Modules/Router.js +291 -0
- package/Bindary/Modules/Scroller.js +89 -0
- package/Bindary/Modules/Template.js +1273 -0
- package/BookmarkSpy/BookmarkSpy.js +430 -0
- package/Box/Box.css +36 -0
- package/Box/Box.js +1685 -0
- package/Button/Button.css +470 -0
- package/Button/Button.js +1398 -0
- package/Button/Themes/Default.css +200 -0
- package/Carousel/Carousel.css +273 -0
- package/Carousel/Carousel.js +607 -0
- package/ColorButton/ColorButton.css +39 -0
- package/ColorButton/ColorButton.js +336 -0
- package/ColorPicker/ColorPicker.css +359 -0
- package/ColorPicker/ColorPicker.js +972 -0
- package/ComboBox/ComboBox.css +357 -0
- package/ComboBox/ComboBox.js +2342 -0
- package/ComboBox/Themes/Default.css +23 -0
- package/DataPager/DataPager.css +72 -0
- package/DataPager/DataPager.js +674 -0
- package/DatePicker/DatePicker.css +227 -0
- package/DatePicker/DatePicker.js +1531 -0
- package/DatePicker/Themes/Default.css +26 -0
- package/Dialog/Dialog.css +106 -0
- package/Dialog/Dialog.js +572 -0
- package/Dialog/Themes/Default.css +10 -0
- package/Editor/Data/Emoji.json +8285 -0
- package/Editor/Data/Special.json +1042 -0
- package/Editor/Editor.css +1562 -0
- package/Editor/Editor.js +4058 -0
- package/Editor/Font/Editor.woff +0 -0
- package/Editor/Modules/ComponentFactory.js +565 -0
- package/Editor/Modules/ContentManager.js +748 -0
- package/Editor/Modules/DialogManager.js +1234 -0
- package/Editor/Modules/EventManager.js +458 -0
- package/Editor/Modules/Format.js +950 -0
- package/Editor/Modules/History.js +191 -0
- package/Editor/Modules/LayoutState.js +379 -0
- package/Editor/Modules/ListManager.js +296 -0
- package/Editor/Modules/MenuManager.js +388 -0
- package/Editor/Modules/NodeManager.js +681 -0
- package/Editor/Modules/ParagraphButtons.js +122 -0
- package/Editor/Modules/Resizer.js +176 -0
- package/Editor/Modules/SelectionRange.js +564 -0
- package/Editor/Modules/SourceViewBuilder.js +212 -0
- package/Editor/Modules/SymbolPicker.js +208 -0
- package/Editor/Modules/Table.js +2327 -0
- package/Editor/Modules/TableDialog.js +757 -0
- package/Editor/Modules/Toolbar.js +375 -0
- package/Editor/Modules/TooltipMenu.js +125 -0
- package/Editor/Modules/Utility.js +131 -0
- package/Editor/Themes/Default.css +204 -0
- package/FileUpload/FileUpload.css +156 -0
- package/FileUpload/FileUpload.js +898 -0
- package/FileUpload/Themes/Default.css +17 -0
- package/Form/Form.css +1934 -0
- package/Form/Form.js +4943 -0
- package/Form/Modules/ActionManager.js +368 -0
- package/Form/Modules/BuildPanelManager.js +319 -0
- package/Form/Modules/ComponentFactory.js +468 -0
- package/Form/Modules/ComponentPanel.js +265 -0
- package/Form/Modules/ConfigPanelManager.js +685 -0
- package/Form/Modules/DataObserver.js +717 -0
- package/Form/Modules/Databinder.js +602 -0
- package/Form/Modules/Draggable.js +756 -0
- package/Form/Modules/OptionsPanel.js +342 -0
- package/Form/Modules/Renderer.js +1889 -0
- package/Form/Modules/RuleEngine.js +585 -0
- package/Form/Modules/RulesPanel.js +1158 -0
- package/Form/Modules/Types.js +1709 -0
- package/Form/Modules/ValidationManager.js +194 -0
- package/Form/Themes/Default.css +216 -0
- package/FormField/FormField.css +468 -0
- package/FormField/FormField.js +576 -0
- package/FormField/Themes/Default.css +99 -0
- package/Grid/Grid.css +544 -0
- package/Grid/Grid.js +3761 -0
- package/Grid/Themes/Default.css +43 -0
- package/LICENSE +126 -0
- package/MaskedTextBox/MaskedTextBox.css +28 -0
- package/MaskedTextBox/MaskedTextBox.js +642 -0
- package/MaskedTextBox/Themes/Default.css +6 -0
- package/Menu/Menu.css +328 -0
- package/Menu/Menu.js +2386 -0
- package/Menu/Themes/Default.css +24 -0
- package/NumericBox/NumericBox.css +120 -0
- package/NumericBox/NumericBox.js +984 -0
- package/PanelBar/PanelBar.css +123 -0
- package/PanelBar/PanelBar.js +505 -0
- package/PanelBar/Themes/Default.css +51 -0
- package/PieChart/PieChart.css +95 -0
- package/PieChart/PieChart.js +820 -0
- package/PieChart/Themes/Default.css +9 -0
- package/README.md +178 -3
- package/Slider/Slider.css +348 -0
- package/Slider/Slider.js +1306 -0
- package/Slider/Themes/Default.css +44 -0
- package/TabStrip/TabStrip.css +52 -0
- package/TabStrip/TabStrip.js +362 -0
- package/TabStrip/Themes/Default.css +35 -0
- package/TimePicker/Themes/Default.css +30 -0
- package/TimePicker/TimePicker.css +253 -0
- package/TimePicker/TimePicker.js +1485 -0
- package/TooltipManager/Themes/Default.css +21 -0
- package/TooltipManager/TooltipManager.css +227 -0
- package/TooltipManager/TooltipManager.js +791 -0
- package/Validator/Validator.css +54 -0
- package/Validator/Validator.js +2508 -0
- package/componyx.html-data.json +619 -0
- package/index.js +27 -0
- package/package.json +43 -4
- package/types/AppSkin.d.ts +842 -0
- package/types/Base.d.ts +1034 -0
- package/types/Bindary.d.ts +1196 -0
- package/types/BookmarkSpy.d.ts +112 -0
- package/types/Box.d.ts +374 -0
- package/types/Button.d.ts +455 -0
- package/types/Carousel.d.ts +136 -0
- package/types/ColorButton.d.ts +120 -0
- package/types/ColorPicker.d.ts +225 -0
- package/types/ComboBox.d.ts +507 -0
- package/types/DataPager.d.ts +152 -0
- package/types/DatePicker.d.ts +354 -0
- package/types/Dialog.d.ts +160 -0
- package/types/Editor.d.ts +1289 -0
- package/types/FileUpload.d.ts +206 -0
- package/types/Form.d.ts +3078 -0
- package/types/FormField.d.ts +204 -0
- package/types/Grid.d.ts +911 -0
- package/types/Library.d.ts +1899 -0
- package/types/MaskedTextBox.d.ts +91 -0
- package/types/Menu.d.ts +577 -0
- package/types/NumericBox.d.ts +310 -0
- package/types/PanelBar.d.ts +223 -0
- package/types/PieChart.d.ts +224 -0
- package/types/ResponsiveTemplates.d.ts +108 -0
- package/types/Slider.d.ts +227 -0
- package/types/TabStrip.d.ts +185 -0
- package/types/TimePicker.d.ts +265 -0
- package/types/TooltipManager.d.ts +178 -0
- package/types/UI.d.ts +29 -0
- package/types/Validator.d.ts +653 -0
- package/types/index.d.ts +59 -0
- package/ui.css +11783 -0
- package/ui.js +79477 -0
- package/ui.min.css +138 -0
- package/ui.min.js +264 -0
- package/ui.min.js.map +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
|
|
2
|
+
.slider.theme.theme-default > div.content > span.handle
|
|
3
|
+
{
|
|
4
|
+
background: var(--cui-slider-handle-bg-color);
|
|
5
|
+
box-shadow: 0px 0px 5px 0px var(--cui-slider-handle-box-shadow-color);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.slider.theme.theme-default:not(.disabled) > div.content > span.handle:hover,
|
|
9
|
+
.slider.theme.theme-default:not(.disabled) > div.content > span.handle:focus
|
|
10
|
+
{
|
|
11
|
+
box-shadow: 0px 0px 5px 0px var(--cui-slider-handle-focus-box-shadow-color);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.slider.theme.theme-default > div.content > div.track
|
|
15
|
+
{
|
|
16
|
+
background: var(--cui-slider-track-bg-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.slider.theme.theme-default > div.content > div.track > div.range
|
|
20
|
+
{
|
|
21
|
+
background: var(--cui-slider-range-bg-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.slider.theme.theme-default:not(.range):not(.reversed) > div.content > ul.ticks > li.tick::before,
|
|
25
|
+
.slider.theme.theme-default:not(.range).reversed > div.content > ul.ticks > li.tick.selected::before,
|
|
26
|
+
.slider.theme.theme-default:not(.range).reversed > div.content > ul.ticks > li.tick.selected ~ ::before,
|
|
27
|
+
.slider.theme.theme-default.range:not(.reversed) > div.content > ul.ticks > li.tick.selected-start::before,
|
|
28
|
+
.slider.theme.theme-default.range:not(.reversed) > div.content > ul.ticks > li.tick.selected-start ~ ::before,
|
|
29
|
+
.slider.theme.theme-default.range.reversed > div.content > ul.ticks > li.tick::before,
|
|
30
|
+
.slider.theme.theme-default.range.reversed > div.content > ul.ticks > li.tick.selected::before,
|
|
31
|
+
.slider.theme.theme-default.range.reversed > div.content > ul.ticks > li.tick.selected ~ ::before
|
|
32
|
+
{
|
|
33
|
+
background: var(--cui-slider-tick-mark-selected-color);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.slider.theme.theme-default:not(.reversed) > div.content > ul.ticks > li.tick.selected ~ ::before,
|
|
37
|
+
.slider.theme.theme-default.range:not(.reversed) > div.content > ul.ticks > li.tick.selected ~ ::before,
|
|
38
|
+
.slider.theme.theme-default:not(.range).reversed > div.content > ul.ticks > li.tick::before,
|
|
39
|
+
.slider.theme.theme-default.range:not(.reversed) > div.content > ul.ticks > li.tick::before,
|
|
40
|
+
.slider.theme.theme-default.range.reversed > div.content > ul.ticks > li.tick.selected-start ~ ::before,
|
|
41
|
+
.slider.theme.theme-default.range.reversed > div.content > ul.ticks > li.tick::before
|
|
42
|
+
{
|
|
43
|
+
background: var(--cui-slider-tick-mark-color);
|
|
44
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
|
|
2
|
+
.tab-strip.theme
|
|
3
|
+
{
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.tab-strip.theme > div.strip
|
|
8
|
+
{
|
|
9
|
+
position: absolute;
|
|
10
|
+
left: 0px;
|
|
11
|
+
right: 0px;
|
|
12
|
+
bottom: 0px;
|
|
13
|
+
border-top-style: solid;
|
|
14
|
+
z-index: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tab-strip.theme.bottom > div.strip
|
|
18
|
+
{
|
|
19
|
+
top: 0px;
|
|
20
|
+
bottom: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tab-strip.theme > .button.theme:not(:last-child)
|
|
24
|
+
{
|
|
25
|
+
position: relative;
|
|
26
|
+
margin-right: 5px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tab-strip.theme:not(.bottom) > .button.theme:not(.split),
|
|
30
|
+
.tab-strip.theme:not(.bottom) > .button.theme.split > div.command,
|
|
31
|
+
.tab-strip.theme:not(.bottom) > .button.theme.split > div.expand
|
|
32
|
+
{
|
|
33
|
+
border-bottom-left-radius: 0px;
|
|
34
|
+
border-bottom-right-radius: 0px;
|
|
35
|
+
border-bottom-color: transparent;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.tab-strip.theme.bottom > .button.theme:not(.split),
|
|
39
|
+
.tab-strip.theme.bottom > .button.theme.split > div.command,
|
|
40
|
+
.tab-strip.theme.bottom > .button.theme.split > div.expand
|
|
41
|
+
{
|
|
42
|
+
border-top-left-radius: 0px;
|
|
43
|
+
border-top-right-radius: 0px;
|
|
44
|
+
border-top-color: transparent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tab-strip.theme > .button.theme.selected,
|
|
48
|
+
.tab-strip.theme > .button.theme.split > div.command.selected
|
|
49
|
+
{
|
|
50
|
+
z-index: 1;
|
|
51
|
+
padding-bottom: 1px;
|
|
52
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
|
|
2
|
+
import '../Base/Base.js';
|
|
3
|
+
import '../Base/Library.js';
|
|
4
|
+
import '../Base/NavigationManager.js';
|
|
5
|
+
import '../Button/Button.js';
|
|
6
|
+
|
|
7
|
+
(async function (window)
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Namespace for tabstrip modules.
|
|
11
|
+
* @namespace componyx.UI.tabStrip_modules
|
|
12
|
+
*/
|
|
13
|
+
componyx.UI.tabStrip_modules = componyx.UI.tabStrip_modules || {};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Promise that resolves when all tabstrip modules are loaded asynchronously.
|
|
17
|
+
* @type {Promise<void>}
|
|
18
|
+
* @memberof componyx.UI.tabStrip_modules
|
|
19
|
+
*/
|
|
20
|
+
componyx.UI.tabStrip_modules.loaded = (async () =>
|
|
21
|
+
{
|
|
22
|
+
// these dynamic imports are removed when files are bundled into UI(.min).js
|
|
23
|
+
})();
|
|
24
|
+
|
|
25
|
+
await componyx.UI.tabStrip_modules.loaded;
|
|
26
|
+
const NavigationManager = componyx.base_modules.NavigationManager;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* TabStrip class.
|
|
30
|
+
* @class
|
|
31
|
+
* @memberof componyx.UI
|
|
32
|
+
* @augments componyx.UI.base.Component
|
|
33
|
+
* @mixes componyx.UI.base.methods
|
|
34
|
+
* @param {String} id The id of the component.
|
|
35
|
+
* @param {Object|HTMLElement} properties The properties used to initialize the component or the container element.
|
|
36
|
+
* @returns {Object} An instance of the component.
|
|
37
|
+
*/
|
|
38
|
+
componyx.UI.TabStrip = function TabStrip(id, properties)
|
|
39
|
+
{
|
|
40
|
+
// define private properties
|
|
41
|
+
var _instance = this;
|
|
42
|
+
$base.static.ThemeOption;
|
|
43
|
+
var _alignmentOption = componyx.UI.TabStrip.AlignmentOption,
|
|
44
|
+
_classOption =
|
|
45
|
+
{
|
|
46
|
+
STRIP: 'strip',
|
|
47
|
+
ITEM: 'item'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// define public properties
|
|
51
|
+
/**
|
|
52
|
+
* Gets or sets a value indicating whether the PostBack event is automatically fired.
|
|
53
|
+
* @type {String}
|
|
54
|
+
*/
|
|
55
|
+
this.cssClassStrip = '';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Gets or sets the default css class of a tab item button.
|
|
59
|
+
* @type {String}
|
|
60
|
+
*/
|
|
61
|
+
this.cssClassItem = '';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Gets or sets the default css class of the tab item button icon.
|
|
65
|
+
* @type {String}
|
|
66
|
+
*/
|
|
67
|
+
this.cssClassItemIcon = '';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Gets or sets the selected item id.
|
|
71
|
+
* @type {String}
|
|
72
|
+
*/
|
|
73
|
+
this.selectedItemId = '';
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Gets or sets the tab alignment.
|
|
77
|
+
* @type {componyx.UI.TabStrip.AlignmentOption}
|
|
78
|
+
*/
|
|
79
|
+
this.alignment = _alignmentOption.TOP;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Gets or sets the id of the component from which the settings are cloned.
|
|
83
|
+
* @type {String|null}
|
|
84
|
+
*/
|
|
85
|
+
this.buttonId = null;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Gets or sets the list of items.
|
|
89
|
+
* @type {componyx.UI.TabStrip.Item[]}
|
|
90
|
+
*/
|
|
91
|
+
this.itemList = [];
|
|
92
|
+
|
|
93
|
+
/** @private
|
|
94
|
+
* @type {componyx.base_modules.NavigationManager}
|
|
95
|
+
*/
|
|
96
|
+
this.navigationManager = null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @class
|
|
100
|
+
* @augments componyx.UI.base.Events
|
|
101
|
+
* @memberof componyx.UI.TabStrip
|
|
102
|
+
* @property {componyx.UI.base.Event} onItemSelect - Event which fires when a tab item is selected. @see {@link componyx.UI.TabStrip.ItemEventArgs}
|
|
103
|
+
* @property {componyx.UI.base.Event} onItemDeselect - Event which fires when a tab item is deselected. @see {@link componyx.UI.TabStrip.ItemEventArgs}
|
|
104
|
+
* @see {@link componyx.UI.base.Events}
|
|
105
|
+
*/
|
|
106
|
+
function TabStripEvents(events)
|
|
107
|
+
{
|
|
108
|
+
Object.assign(this, events);
|
|
109
|
+
this.onItemSelect = $base.static.createEvent('onItemSelect');
|
|
110
|
+
this.onItemDeselect = $base.static.createEvent('onItemDeselect');
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* TabStrip events
|
|
114
|
+
* @type {componyx.UI.TabStrip.TabStripEvents}
|
|
115
|
+
*/
|
|
116
|
+
this.events = new TabStripEvents(this.events);
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* TabStrip item event arguments.
|
|
120
|
+
* @typedef {Object} ItemEventArgs
|
|
121
|
+
* @memberof componyx.UI.TabStrip
|
|
122
|
+
* @property {componyx.UI.Button} button - The tab button.
|
|
123
|
+
* @property {componyx.UI.TabStrip.Item} item - The tab item.
|
|
124
|
+
* @property {Event} event - The original event object.
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
// inherit base instance members
|
|
128
|
+
$base.Component.apply(this, [id, properties]);
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Renders the component
|
|
132
|
+
*/
|
|
133
|
+
this.render = function ()
|
|
134
|
+
{
|
|
135
|
+
if (_instance.renderState != $base.static.RenderState.RENDERING)
|
|
136
|
+
{
|
|
137
|
+
// call base render and return
|
|
138
|
+
$base.methods.render.call(_instance, preRender, 'tab-strip');
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// render logic after loading resources
|
|
143
|
+
_instance.element.tabIndex = Number(_instance.tabIndex) || 0; // tabStrip widget is focusable, arrows are used to navigate tab-items
|
|
144
|
+
draw();
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Destroys the component.
|
|
149
|
+
* @see {@link componyx.UI.base.methods#destroy}
|
|
150
|
+
*/
|
|
151
|
+
this.destroy = function (...args)
|
|
152
|
+
{
|
|
153
|
+
dispose();
|
|
154
|
+
$base.methods.destroy.call(this, ...args);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
function preRender()
|
|
158
|
+
{
|
|
159
|
+
// initialize script and css
|
|
160
|
+
return ['TabStrip', ['Button']];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function draw()
|
|
164
|
+
{
|
|
165
|
+
var strip = document.createElement('div'),
|
|
166
|
+
selectFirst = true;
|
|
167
|
+
|
|
168
|
+
strip.className = _classOption.STRIP;
|
|
169
|
+
$lib.addClass(_instance.element, _alignmentOption.getName(_instance.alignment));
|
|
170
|
+
|
|
171
|
+
$lib.each(_instance.itemList, function (item, index)
|
|
172
|
+
{
|
|
173
|
+
if ($lib.isEmpty(item.id))
|
|
174
|
+
item.id = index;
|
|
175
|
+
|
|
176
|
+
createTab(item);
|
|
177
|
+
|
|
178
|
+
if (item.selected)
|
|
179
|
+
selectFirst = false;
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
_instance.element.appendChild(strip);
|
|
183
|
+
_instance.element.setAttribute('role', 'tablist');
|
|
184
|
+
|
|
185
|
+
if (_instance.selectedItemId)
|
|
186
|
+
$UI.store[getItemId(_instance.selectedItemId)].select();
|
|
187
|
+
else if (selectFirst)
|
|
188
|
+
$UI.store[getItemId(_instance.itemList[0].id)].select();
|
|
189
|
+
|
|
190
|
+
$lib.on(_instance.element, 'focus', focus);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function focus()
|
|
194
|
+
{
|
|
195
|
+
if (!_instance.navigationManager)
|
|
196
|
+
return;
|
|
197
|
+
|
|
198
|
+
const active = _instance.element.ownerDocument.activeElement;
|
|
199
|
+
if (_instance.element.contains(active) && active !== _instance.element)
|
|
200
|
+
return; // focus is already on a child, so skip resetting focus
|
|
201
|
+
|
|
202
|
+
_instance.navigationManager.setFocus(_instance.itemList[0].id);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function createTab(item)
|
|
206
|
+
{
|
|
207
|
+
var tab = $UI.createComponent(componyx.UI.Button, { id: getItemId(item.id), containerElement: _instance.element }),
|
|
208
|
+
cloneId = item.buttonId || _instance.buttonId;
|
|
209
|
+
|
|
210
|
+
tab.clone($UI.store[cloneId], _instance);
|
|
211
|
+
tab.renderId = false;
|
|
212
|
+
tab.cssClass = 'button ' + (item.cssClass || _instance.cssClassItem || _classOption.ITEM);
|
|
213
|
+
tab.cssClassIcon = item.cssClassIcon || _instance.cssClassItemIcon;
|
|
214
|
+
tab.hasIcon = item.hasIcon || false;
|
|
215
|
+
tab.iconURL = item.iconURL;
|
|
216
|
+
tab.selected = item.selected;
|
|
217
|
+
tab.disabled = item.disabled;
|
|
218
|
+
tab.split = item.split;
|
|
219
|
+
|
|
220
|
+
if (!$lib.isEmpty(item.transparent))
|
|
221
|
+
tab.transparent = item.transparent;
|
|
222
|
+
else if (!cloneId)
|
|
223
|
+
tab.transparent = true;
|
|
224
|
+
|
|
225
|
+
if (!$lib.isEmpty(item.transparentBorder))
|
|
226
|
+
tab.transparentBorder = item.transparentBorder;
|
|
227
|
+
else if (!cloneId)
|
|
228
|
+
tab.transparentBorder = false;
|
|
229
|
+
|
|
230
|
+
if (!$lib.isEmpty(item.primary))
|
|
231
|
+
tab.primary = item.primary;
|
|
232
|
+
else if (!cloneId)
|
|
233
|
+
tab.primary = false;
|
|
234
|
+
|
|
235
|
+
if (!$lib.isEmpty(item.decoration))
|
|
236
|
+
tab.decoration = item.decoration;
|
|
237
|
+
else if (!cloneId)
|
|
238
|
+
tab.decoration = (_instance.alignment == _alignmentOption.TOP) ? componyx.UI.Button.DecorationOption.OVERLINE : componyx.UI.Button.DecorationOption.UNDERLINE;
|
|
239
|
+
|
|
240
|
+
tab.menuId = item.menuId;
|
|
241
|
+
tab.menuItemId = item.menuItemId;
|
|
242
|
+
tab.boxId = item.boxId;
|
|
243
|
+
tab.type = componyx.UI.Button.TypeOption.RADIOBUTTON;
|
|
244
|
+
tab.radioGroupId = _instance.id;
|
|
245
|
+
tab.tabIndex = -1;
|
|
246
|
+
tab.events.onSelect.priorityAdd(function (sender, args) { _instance.events.onItemSelect.fire(_instance, eventArgs(sender, item)); });
|
|
247
|
+
tab.events.onDeselect.priorityAdd(function (sender, args) { _instance.events.onItemDeselect.fire(_instance, eventArgs(sender, item)); });
|
|
248
|
+
|
|
249
|
+
if (item.content)
|
|
250
|
+
tab.setContentTemplate(item.content);
|
|
251
|
+
else
|
|
252
|
+
tab.text = item.text;
|
|
253
|
+
|
|
254
|
+
tab.events.onClick.priorityAdd((button, event) =>
|
|
255
|
+
{
|
|
256
|
+
_instance.navigationManager.setFocusFromEvent(item, event);
|
|
257
|
+
});
|
|
258
|
+
tab.events.onPostRender.priorityAdd((tab) =>
|
|
259
|
+
{
|
|
260
|
+
tab.getCommandButton().setAttribute('role', 'tab');
|
|
261
|
+
createNavigationManager();
|
|
262
|
+
setTimeout(() => { _instance.isReady.apply(_instance); });
|
|
263
|
+
}, null);
|
|
264
|
+
|
|
265
|
+
tab.show();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function createNavigationManager()
|
|
269
|
+
{
|
|
270
|
+
if (_instance.navigationManager)
|
|
271
|
+
return;
|
|
272
|
+
|
|
273
|
+
_instance.navigationManager = new NavigationManager(_instance.element,
|
|
274
|
+
{
|
|
275
|
+
itemList: _instance.itemList,
|
|
276
|
+
horizontalRoot: true,
|
|
277
|
+
tabNavigation: true,
|
|
278
|
+
getButton: (item) => $UI.store[getItemId(item.id)]?.element,
|
|
279
|
+
isExpandable: (item) => false,
|
|
280
|
+
isFocusable: (item) => !Boolean(item.disabled)
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function getItemId(id)
|
|
285
|
+
{
|
|
286
|
+
return $lib.format('{0}_{1}', _instance.id, id);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function eventArgs(button, item)
|
|
290
|
+
{
|
|
291
|
+
return { button: button, item: item, event: $lib.event }
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function dispose()
|
|
295
|
+
{
|
|
296
|
+
_instance.navigationManager?.destroy();
|
|
297
|
+
_instance.navigationManager = null;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @see {@link componyx.UI.base.methods}
|
|
303
|
+
*/
|
|
304
|
+
componyx.UI.TabStrip.prototype = Object.create($base.methods);
|
|
305
|
+
componyx.UI.TabStrip.prototype.constructor = componyx.UI.TabStrip;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* AlignmentOption
|
|
309
|
+
* @readonly
|
|
310
|
+
* @enum {number}
|
|
311
|
+
*/
|
|
312
|
+
componyx.UI.TabStrip.AlignmentOption =
|
|
313
|
+
{
|
|
314
|
+
TOP: 0,
|
|
315
|
+
BOTTOM: 1,
|
|
316
|
+
|
|
317
|
+
getName: function (value) { return $base.static.getKeyByValue(this, value).toLowerCase(); }
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Creates an instance of the TabStrip item.
|
|
322
|
+
* @class
|
|
323
|
+
* @param {Object} properties The properties used to initialize the object.
|
|
324
|
+
* @property {HTMLElement[]|HTMLElement} content Gets or sets the content template of the item.
|
|
325
|
+
* @property {Boolean} hasIcon Gets or sets a value indicating if the item has an icon.
|
|
326
|
+
* @property {String} cssClassIcon Gets or sets the css class of the icon.
|
|
327
|
+
* @property {String} iconURL Gets or sets the URL of the icon.
|
|
328
|
+
* @property {Boolean} split Gets or sets a value indicating if the button has two actions.
|
|
329
|
+
* @property {Boolean} transparent Gets or sets a value indicating if the button's default background color is transparent.
|
|
330
|
+
* @property {Boolean} transparentBorder Gets or sets a value indicating if the button's default border color is transparent.
|
|
331
|
+
* @property {Boolean} primary Gets or sets a value indicating if the button is a primary button. When disabled the button's default style will be less prominent (basic) unless styled otherwise.
|
|
332
|
+
* @property {Button.DecorationOption} decoration Gets or sets the decoration type used when the button is hovered/selected.
|
|
333
|
+
* @property {String} menuId Gets or sets the id of the menu component.
|
|
334
|
+
* @property {String} menuItemId Gets or sets the id of the menu item.
|
|
335
|
+
* @property {String} boxId Gets or sets the id of the box component.
|
|
336
|
+
* @property {String} buttonId Gets or sets the id of the button component.
|
|
337
|
+
* @augments componyx.UI.base.Item
|
|
338
|
+
* @see {@link componyx.UI.base.Item}
|
|
339
|
+
*/
|
|
340
|
+
componyx.UI.TabStrip.Item = function (properties)
|
|
341
|
+
{
|
|
342
|
+
this.content = null;
|
|
343
|
+
this.hasIcon = null;
|
|
344
|
+
this.cssClassIcon = '';
|
|
345
|
+
this.iconURL = null;
|
|
346
|
+
this.split = null;
|
|
347
|
+
this.transparent = null;
|
|
348
|
+
this.transparentBorder = null;
|
|
349
|
+
this.primary = null;
|
|
350
|
+
this.decoration = null;
|
|
351
|
+
this.menuId = null;
|
|
352
|
+
this.menuItemId = null;
|
|
353
|
+
this.boxId = null;
|
|
354
|
+
this.buttonId = null;
|
|
355
|
+
|
|
356
|
+
$base.static.Item.call(this, properties);
|
|
357
|
+
};
|
|
358
|
+
})();
|
|
359
|
+
|
|
360
|
+
const TabStrip = componyx.UI.TabStrip;
|
|
361
|
+
|
|
362
|
+
export { TabStrip };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
|
|
2
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default:not(.split).selected:not(.disabled),
|
|
3
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default.split > div.command.selected:not(.disabled),
|
|
4
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default.split > div.command.selected:not(.disabled) + div.expand,
|
|
5
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default:not(.split).selected:not(.disabled):hover,
|
|
6
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default.split > div.command.selected:not(.disabled):hover,
|
|
7
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default:not(.split):not(.disabled).selected:focus,
|
|
8
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default.split:not(.disabled) > div.command.selected:focus,
|
|
9
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default:not(.disabled).expanded
|
|
10
|
+
{
|
|
11
|
+
color: var(--cui-color-on-surface);
|
|
12
|
+
background: var(--cui-color-surface);
|
|
13
|
+
border-top-color: var(--cui-button-border-color);
|
|
14
|
+
border-left-color: var(--cui-button-border-color);
|
|
15
|
+
border-right-color: var(--cui-button-border-color);
|
|
16
|
+
border-bottom-color: var(--cui-color-surface);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default:not(.split).selected:not(.disabled),
|
|
20
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default.split > div.command.selected:not(.disabled),
|
|
21
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default.split > div.command.selected:not(.disabled) + div.expand,
|
|
22
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default:not(.split).selected:not(.disabled):hover,
|
|
23
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default.split > div.command.selected:not(.disabled):hover,
|
|
24
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default:not(.split):not(.disabled).selected:focus,
|
|
25
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default.split:not(.disabled) > div.command.selected:focus,
|
|
26
|
+
.tab-strip.theme.theme-default.bottom > .button.theme.theme-default:not(.disabled).expanded
|
|
27
|
+
{
|
|
28
|
+
border-bottom-color: var(--cui-button-border-color);
|
|
29
|
+
border-top-color: var(--cui-color-surface);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tab-strip.theme.theme-default > .button.theme.theme-default.split > div.command.selected:not(.disabled)
|
|
33
|
+
{
|
|
34
|
+
border-right-color: var(--cui-button-border-color);
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
|
|
2
|
+
.time-picker.theme.theme-default .clock
|
|
3
|
+
{
|
|
4
|
+
background: var(--cui-base-bg-color); /* base BG color */
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.time-picker.theme.theme-default .clock .clock-hand,
|
|
8
|
+
.time-picker.theme.theme-default .clock .clock-hand::before,
|
|
9
|
+
.time-picker.theme.theme-default .clock .clock-hand::after
|
|
10
|
+
{
|
|
11
|
+
background: var(--cui-base-dark-bg-color); /* base darker BG color */
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.time-picker.theme.theme-default .clock .clock-hand.selected,
|
|
15
|
+
.time-picker.theme.theme-default .clock .clock-hand.selected::before,
|
|
16
|
+
.time-picker.theme.theme-default .clock .clock-hand.selected::after
|
|
17
|
+
{
|
|
18
|
+
background: var(--cui-button-bg-color); /* primary BG color */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.time-picker.theme.theme-default .clock .clock-item.selected,
|
|
22
|
+
.time-picker.theme.theme-default .clock .clock-hand.selected > *
|
|
23
|
+
{
|
|
24
|
+
color: var(--cui-button-text-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.time-picker.theme.theme-default .clock .clock-hand:focus::after
|
|
28
|
+
{
|
|
29
|
+
box-shadow: inset 0 -12px 0px -8px var(--cui-focus-box-shadow-color);
|
|
30
|
+
}
|