jsl-ui 9.18.3 → 9.19.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/lib/components/IntervalComponent.d.ts +17 -0
- package/lib/components/IntervalComponent.js +68 -0
- package/lib/components/auto-suggest/AutoSuggestComponent.d.ts +22 -0
- package/lib/components/auto-suggest/AutoSuggestComponent.js +49 -0
- package/lib/components/button/ButtonComponent.d.ts +18 -0
- package/lib/components/button/ButtonComponent.js +46 -0
- package/lib/components/checkbox/CheckBoxComponent.d.ts +28 -0
- package/lib/components/checkbox/CheckBoxComponent.js +94 -0
- package/lib/components/checkbox/CheckBoxStyle.scss +86 -0
- package/lib/components/date/DateComponent.d.ts +32 -0
- package/lib/components/date/DateComponent.js +106 -0
- package/lib/components/date-range/DateRangeComponent.d.ts +35 -0
- package/lib/components/date-range/DateRangeComponent.js +136 -0
- package/lib/components/date-range/DateRangeStyle.scss +12 -0
- package/lib/components/date-time/DateTimeComponent.d.ts +15 -0
- package/lib/components/date-time/DateTimeComponent.js +53 -0
- package/lib/components/date-time/DateTimeStyle.scss +7 -0
- package/lib/components/dialog/DialogComponent.d.ts +67 -0
- package/lib/components/dialog/DialogComponent.js +242 -0
- package/lib/components/drop-down/DropDownComponent.d.ts +27 -0
- package/lib/components/drop-down/DropDownComponent.js +74 -0
- package/lib/components/expander/ExpanderComponent.d.ts +27 -0
- package/lib/components/expander/ExpanderComponent.js +90 -0
- package/lib/components/expander/ExpanderStyle.scss +47 -0
- package/lib/components/expander/OldExpanderStyle.scss +37 -0
- package/lib/components/form-field/FormComponent.d.ts +12 -0
- package/lib/components/form-field/FormComponent.js +26 -0
- package/lib/components/form-field/FormFieldComponent.d.ts +38 -0
- package/lib/components/form-field/FormFieldComponent.js +139 -0
- package/lib/components/form-field/FormFieldStyle.scss +87 -0
- package/lib/components/grid/GridComponent.d.ts +26 -0
- package/lib/components/grid/GridComponent.js +116 -0
- package/lib/components/input/InputComponent.d.ts +33 -0
- package/lib/components/input/InputComponent.js +144 -0
- package/lib/components/loading/LoadingComponent.d.ts +8 -0
- package/lib/components/loading/LoadingComponent.js +22 -0
- package/lib/components/loading/LoadingStyle.css +29 -0
- package/lib/components/navigation/NavigationComponent.d.ts +34 -0
- package/lib/components/navigation/NavigationComponent.js +70 -0
- package/lib/components/navigation/NavigationStyle.scss +226 -0
- package/lib/components/notification/Notification.d.ts +17 -0
- package/lib/components/notification/Notification.js +56 -0
- package/lib/components/notification/Notification.scss +19 -0
- package/lib/components/number/NumberComponent.d.ts +25 -0
- package/lib/components/number/NumberComponent.js +87 -0
- package/lib/components/overlay/OverlayComponent.d.ts +27 -0
- package/lib/components/overlay/OverlayComponent.js +149 -0
- package/lib/components/overlay/overlay.css +57 -0
- package/lib/components/progress/ProgressComponent.d.ts +18 -0
- package/lib/components/progress/ProgressComponent.js +42 -0
- package/lib/components/progress/ProgressStyle.scss +15 -0
- package/lib/components/ribbon-menu/RibbonMenuComponent.d.ts +12 -0
- package/lib/components/ribbon-menu/RibbonMenuComponent.js +34 -0
- package/lib/components/ribbon-menu/RibbonMenuStyle.scss +76 -0
- package/lib/components/select/SelectComponent.d.ts +79 -0
- package/lib/components/select/SelectComponent.js +362 -0
- package/lib/components/select/SelectDDAreaComponent.d.ts +32 -0
- package/lib/components/select/SelectDDAreaComponent.js +317 -0
- package/lib/components/select/SelectStyle.scss +187 -0
- package/lib/components/slider/nouislider.css +310 -0
- package/lib/components/slider/nouislider.d.ts +44 -0
- package/lib/components/slider/nouislider.js +2158 -0
- package/lib/components/stack-panel/SplitterComponent.d.ts +21 -0
- package/lib/components/stack-panel/SplitterComponent.js +126 -0
- package/lib/components/stack-panel/SplitterStyle.scss +45 -0
- package/lib/components/stack-panel/StackPanelComponent.d.ts +20 -0
- package/lib/components/stack-panel/StackPanelComponent.js +64 -0
- package/lib/components/stack-panel/StackPanelStyle.scss +53 -0
- package/lib/components/tabs/TabsComponent.d.ts +39 -0
- package/lib/components/tabs/TabsComponent.js +177 -0
- package/lib/components/tabs/TabsStyle.scss +76 -0
- package/lib/components/time/TimeComponent.d.ts +29 -0
- package/lib/components/time/TimeComponent.js +113 -0
- package/lib/components/time/TimeComponent.scss +4 -0
- package/lib/components/tree-view/TreeViewComponent.d.ts +23 -0
- package/lib/components/tree-view/TreeViewComponent.js +45 -0
- package/lib/components/tree-view/TreeViewStyle.scss +96 -0
- package/lib/components/virtual-render/VirtualRenderComponent.d.ts +30 -0
- package/lib/components/virtual-render/VirtualRenderComponent.js +104 -0
- package/lib/components/virtual-render/VirtualRenderStyle.scss +9 -0
- package/lib/core/culture.d.ts +5 -0
- package/lib/core/culture.js +385 -0
- package/lib/core/date.d.ts +14 -0
- package/lib/core/date.js +350 -0
- package/lib/core/helper.d.ts +12 -0
- package/lib/core/helper.js +101 -0
- package/lib/core/jq.d.ts +37 -0
- package/lib/core/jq.js +371 -0
- package/lib/core/lang.d.ts +24 -0
- package/lib/core/lang.js +28 -0
- package/lib/core/numeric.d.ts +7 -0
- package/lib/core/numeric.js +143 -0
- package/lib/core/polyfills.d.ts +0 -0
- package/lib/core/polyfills.js +22 -0
- package/lib/core.d.ts +6 -0
- package/lib/core.js +6 -0
- package/lib/grid/controls/slick.columnpicker.css +46 -0
- package/lib/grid/controls/slick.draggablegrouping.css +52 -0
- package/lib/grid/controls/slick.gridmenu.css +127 -0
- package/lib/grid/controls/slick.pager.css +41 -0
- package/lib/grid/examples/examples.css +203 -0
- package/lib/grid/filterDialogs/dateRangeFilter.d.ts +7 -0
- package/lib/grid/filterDialogs/dateRangeFilter.js +156 -0
- package/lib/grid/filterDialogs/excelFilter.d.ts +9 -0
- package/lib/grid/filterDialogs/excelFilter.js +313 -0
- package/lib/grid/plugins/ext.overlay.css +28 -0
- package/lib/grid/plugins/ext.overlay.d.ts +2 -0
- package/lib/grid/plugins/ext.overlay.js +291 -0
- package/lib/grid/plugins/slick.cellrangedecorator.d.ts +12 -0
- package/lib/grid/plugins/slick.cellrangedecorator.js +68 -0
- package/lib/grid/plugins/slick.cellrangeselector.d.ts +1 -0
- package/lib/grid/plugins/slick.cellrangeselector.js +144 -0
- package/lib/grid/plugins/slick.cellselectionmodel.d.ts +1 -0
- package/lib/grid/plugins/slick.cellselectionmodel.js +194 -0
- package/lib/grid/plugins/slick.headerbuttons.css +40 -0
- package/lib/grid/plugins/slick.headerbuttons.d.ts +55 -0
- package/lib/grid/plugins/slick.headerbuttons.js +156 -0
- package/lib/grid/plugins/slick.headermenu.css +101 -0
- package/lib/grid/plugins/slick.headermenu.d.ts +74 -0
- package/lib/grid/plugins/slick.headermenu.js +260 -0
- package/lib/grid/plugins/slick.rowdetailview.css +37 -0
- package/lib/grid/plugins/slick.rowmovemanager.css +8 -0
- package/lib/grid/plugins/slick.rowmovemanager.d.ts +18 -0
- package/lib/grid/plugins/slick.rowmovemanager.js +249 -0
- package/lib/grid/plugins/slick.rowselectionmodel.d.ts +1 -0
- package/lib/grid/plugins/slick.rowselectionmodel.js +167 -0
- package/lib/grid/slick-default-theme.css +154 -0
- package/lib/grid/slick.core.d.ts +90 -0
- package/lib/grid/slick.core.js +574 -0
- package/lib/grid/slick.creator.d.ts +80 -0
- package/lib/grid/slick.creator.js +723 -0
- package/lib/grid/slick.dataview.d.ts +71 -0
- package/lib/grid/slick.dataview.js +1080 -0
- package/lib/grid/slick.editors.core.d.ts +4 -0
- package/lib/grid/slick.editors.core.js +232 -0
- package/lib/grid/slick.editors.date.d.ts +2 -0
- package/lib/grid/slick.editors.date.js +125 -0
- package/lib/grid/slick.editors.lookup.d.ts +14 -0
- package/lib/grid/slick.editors.lookup.js +353 -0
- package/lib/grid/slick.editors.nav.d.ts +6 -0
- package/lib/grid/slick.editors.nav.js +22 -0
- package/lib/grid/slick.formatters.d.ts +17 -0
- package/lib/grid/slick.formatters.js +137 -0
- package/lib/grid/slick.grid.css +325 -0
- package/lib/grid/slick.grid.d.ts +284 -0
- package/lib/grid/slick.grid.js +5395 -0
- package/lib/grid/slick.groupitemmetadataprovider.d.ts +39 -0
- package/lib/grid/slick.groupitemmetadataprovider.js +165 -0
- package/lib/grid/slick.tree.css +20 -0
- package/lib/grid/slick.tree.d.ts +33 -0
- package/lib/grid/slick.tree.js +220 -0
- package/lib/grid.d.ts +13 -0
- package/lib/grid.js +13 -0
- package/lib/index.css +2576 -0
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +56 -0
- package/lib/index.js +61 -10198
- package/lib/index.js.map +1 -1
- package/lib/interaction/dataconverter.d.ts +4 -0
- package/lib/interaction/dataconverter.js +1 -0
- package/lib/interaction/eventhandler.d.ts +13 -0
- package/lib/interaction/eventhandler.js +42 -0
- package/lib/interaction/moveable.css +0 -0
- package/lib/interaction/moveable.d.ts +39 -0
- package/lib/interaction/moveable.js +172 -0
- package/lib/interaction/resizable.css +33 -0
- package/lib/interaction/resizable.d.ts +37 -0
- package/lib/interaction/resizable.js +123 -0
- package/lib/ui/auto.suggest.css +14 -0
- package/lib/ui/auto.suggest.d.ts +18 -0
- package/lib/ui/auto.suggest.js +258 -0
- package/lib/ui/base.css +150 -0
- package/lib/ui/date.picker/css/date-range-picker.css +87 -0
- package/lib/ui/date.picker/css/tiny-date-picker.css +326 -0
- package/lib/ui/date.picker/date-picker-options.d.ts +11 -0
- package/lib/ui/date.picker/date-picker-options.js +76 -0
- package/lib/ui/date.picker/lib/date-manip.d.ts +74 -0
- package/lib/ui/date.picker/lib/date-manip.js +120 -0
- package/lib/ui/date.picker/lib/dom.d.ts +23 -0
- package/lib/ui/date.picker/lib/dom.js +28 -0
- package/lib/ui/date.picker/lib/emitter.d.ts +13 -0
- package/lib/ui/date.picker/lib/emitter.js +49 -0
- package/lib/ui/date.picker/lib/fns.d.ts +23 -0
- package/lib/ui/date.picker/lib/fns.js +43 -0
- package/lib/ui/date.picker/mode/base-mode.d.ts +26 -0
- package/lib/ui/date.picker/mode/base-mode.js +248 -0
- package/lib/ui/date.picker/mode/dropdown-mode.d.ts +28 -0
- package/lib/ui/date.picker/mode/dropdown-mode.js +50 -0
- package/lib/ui/date.picker/mode/index.d.ts +28 -0
- package/lib/ui/date.picker/mode/index.js +18 -0
- package/lib/ui/date.picker/mode/modal-mode.d.ts +25 -0
- package/lib/ui/date.picker/mode/modal-mode.js +17 -0
- package/lib/ui/date.picker/mode/permanent-mode.d.ts +29 -0
- package/lib/ui/date.picker/mode/permanent-mode.js +19 -0
- package/lib/ui/date.picker/views/day-picker.d.ts +40 -0
- package/lib/ui/date.picker/views/day-picker.js +155 -0
- package/lib/ui/date.picker/views/month-picker.d.ts +26 -0
- package/lib/ui/date.picker/views/month-picker.js +65 -0
- package/lib/ui/date.picker/views/year-picker.d.ts +20 -0
- package/lib/ui/date.picker/views/year-picker.js +66 -0
- package/lib/ui/date.picker.d.ts +66 -0
- package/lib/ui/date.picker.js +32 -0
- package/lib/ui/dialog.css +109 -0
- package/lib/ui/dialog.d.ts +22 -0
- package/lib/ui/dialog.js +113 -0
- package/lib/ui/drop.down.css +472 -0
- package/lib/ui/drop.down.d.ts +52 -0
- package/lib/ui/drop.down.js +2112 -0
- package/lib/ui/number.input.css +3 -0
- package/lib/ui/number.input.d.ts +12 -0
- package/lib/ui/number.input.js +64 -0
- package/lib/ui/tabs.css +53 -0
- package/package.json +1 -1
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import "./auto.suggest.css";
|
|
13
|
+
var autoComplete = (function () {
|
|
14
|
+
function autoComplete(options) {
|
|
15
|
+
// helpers
|
|
16
|
+
function hasClass(el, className) { return el.classList.contains(className); }
|
|
17
|
+
function addEvent(el, type, handler) {
|
|
18
|
+
el.addEventListener(type, handler);
|
|
19
|
+
}
|
|
20
|
+
function removeEvent(el, type, handler) {
|
|
21
|
+
// if (el.removeEventListener) not working in IE11
|
|
22
|
+
el.removeEventListener(type, handler);
|
|
23
|
+
}
|
|
24
|
+
function live(elClass, event, cb, context) {
|
|
25
|
+
addEvent(context || document, event, function (e) {
|
|
26
|
+
var found;
|
|
27
|
+
var el = e.target || e.srcElement;
|
|
28
|
+
while (el && !(found = hasClass(el, elClass))) {
|
|
29
|
+
el = el.parentElement;
|
|
30
|
+
}
|
|
31
|
+
if (found) {
|
|
32
|
+
cb.call(el, e);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
var o = {
|
|
37
|
+
selector: "",
|
|
38
|
+
source: function (val, s) { return []; },
|
|
39
|
+
minChars: 0,
|
|
40
|
+
delay: 150,
|
|
41
|
+
offsetLeft: 0,
|
|
42
|
+
offsetTop: 1,
|
|
43
|
+
cache: false,
|
|
44
|
+
menuClass: '',
|
|
45
|
+
renderItem: function (item, search) {
|
|
46
|
+
// escape special characters
|
|
47
|
+
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
48
|
+
var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
|
|
49
|
+
return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>") + '</div>';
|
|
50
|
+
},
|
|
51
|
+
onSelect: function (e, term, item) { }
|
|
52
|
+
};
|
|
53
|
+
for (var k in options) {
|
|
54
|
+
if (options.hasOwnProperty(k)) {
|
|
55
|
+
o[k] = options[k];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// init
|
|
59
|
+
var elems = typeof o.selector === 'object' ? [o.selector] : document.querySelectorAll(o.selector);
|
|
60
|
+
var _loop_1 = function (i) {
|
|
61
|
+
var that = elems[i];
|
|
62
|
+
// create suggestions container "sc"
|
|
63
|
+
that.sc = document.createElement('div');
|
|
64
|
+
that.sc.className = 'autocomplete-suggestions ' + o.menuClass;
|
|
65
|
+
that.autocompleteAttr = that.getAttribute('autocomplete');
|
|
66
|
+
that.setAttribute('autocomplete', 'off');
|
|
67
|
+
that.cache = {};
|
|
68
|
+
that.last_val = '';
|
|
69
|
+
that.updateSC = function (resize, next) {
|
|
70
|
+
var rect = that.getBoundingClientRect();
|
|
71
|
+
that.sc.style.left = Math.round(rect.left + (window.pageXOffset || document.documentElement.scrollLeft) + o.offsetLeft) + 'px';
|
|
72
|
+
that.sc.style.top = Math.round(rect.bottom + (window.pageYOffset || document.documentElement.scrollTop) + o.offsetTop) + 'px';
|
|
73
|
+
that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth
|
|
74
|
+
if (!resize) {
|
|
75
|
+
that.sc.style.display = 'block';
|
|
76
|
+
if (!that.sc.maxHeight) {
|
|
77
|
+
that.sc.maxHeight = parseInt((window.getComputedStyle ? getComputedStyle(that.sc, null) : that.sc.currentStyle).maxHeight, 10);
|
|
78
|
+
}
|
|
79
|
+
if (!that.sc.suggestionHeight) {
|
|
80
|
+
that.sc.suggestionHeight = that.sc.querySelector('.autocomplete-suggestion').offsetHeight;
|
|
81
|
+
}
|
|
82
|
+
if (that.sc.suggestionHeight) {
|
|
83
|
+
if (!next) {
|
|
84
|
+
that.sc.scrollTop = 0;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
var scrTop = that.sc.scrollTop, selTop = next.getBoundingClientRect().top - that.sc.getBoundingClientRect().top;
|
|
88
|
+
if (selTop + that.sc.suggestionHeight - that.sc.maxHeight > 0) {
|
|
89
|
+
that.sc.scrollTop = selTop + that.sc.suggestionHeight + scrTop - that.sc.maxHeight;
|
|
90
|
+
}
|
|
91
|
+
else if (selTop < 0) {
|
|
92
|
+
that.sc.scrollTop = selTop + scrTop;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
addEvent(window, 'resize', that.updateSC);
|
|
99
|
+
document.body.appendChild(that.sc);
|
|
100
|
+
live('autocomplete-suggestion', 'mouseleave', function (e) {
|
|
101
|
+
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
102
|
+
if (sel) {
|
|
103
|
+
setTimeout(function () { sel.className = sel.className.replace('selected', ''); }, 20);
|
|
104
|
+
}
|
|
105
|
+
}, that.sc);
|
|
106
|
+
live('autocomplete-suggestion', 'mouseover', function (e) {
|
|
107
|
+
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
108
|
+
if (sel) {
|
|
109
|
+
sel.className = sel.className.replace('selected', '');
|
|
110
|
+
}
|
|
111
|
+
this.className += ' selected';
|
|
112
|
+
}, that.sc);
|
|
113
|
+
live('autocomplete-suggestion', 'mousedown', function (e) {
|
|
114
|
+
// window.setTimeout(() => {
|
|
115
|
+
if (hasClass(this, 'autocomplete-suggestion')) { // else outside click
|
|
116
|
+
var v = this.getAttribute('data-val');
|
|
117
|
+
that.value = v;
|
|
118
|
+
o.onSelect(e, v, this);
|
|
119
|
+
that.sc.style.display = 'none';
|
|
120
|
+
}
|
|
121
|
+
// }, 1000);
|
|
122
|
+
}, that.sc);
|
|
123
|
+
that.blurHandler = function () {
|
|
124
|
+
//var over_sb;
|
|
125
|
+
//try { over_sb = document.querySelector('.autocomplete-suggestions:hover'); } catch (e) { over_sb = 0; }
|
|
126
|
+
//if (!over_sb) {
|
|
127
|
+
if (that.last_val !== that.value) {
|
|
128
|
+
options.onChange(that.value);
|
|
129
|
+
}
|
|
130
|
+
that.last_val = that.value;
|
|
131
|
+
that.sc.style.display = 'none';
|
|
132
|
+
//setTimeout(function() { that.sc.style.display = 'none'; }, 350); // hide suggestions on fast input
|
|
133
|
+
//} else if (that !== document.activeElement) { setTimeout(function() { that.focus(); }, 200); }
|
|
134
|
+
};
|
|
135
|
+
addEvent(that, 'blur', that.blurHandler);
|
|
136
|
+
suggest = function (data) {
|
|
137
|
+
var val = that.value;
|
|
138
|
+
that.cache[val] = data;
|
|
139
|
+
if (data.length && val.length >= o.minChars) {
|
|
140
|
+
var s = '';
|
|
141
|
+
for (var i = 0; i < data.length; i++) {
|
|
142
|
+
s += o.renderItem(data[i], val);
|
|
143
|
+
}
|
|
144
|
+
that.sc.innerHTML = s;
|
|
145
|
+
that.updateSC(0);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
that.sc.style.display = 'none';
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
that.keydownHandler = function (e) {
|
|
152
|
+
var key = window.event ? e.keyCode : e.which;
|
|
153
|
+
// down (40), up (38)
|
|
154
|
+
if ((key === 40 || key === 38) && that.sc.innerHTML) {
|
|
155
|
+
var next, sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
156
|
+
if (!sel) {
|
|
157
|
+
next = (key == 40) ? that.sc.querySelector('.autocomplete-suggestion') : that.sc.childNodes[that.sc.childNodes.length - 1]; // first : last
|
|
158
|
+
next.className += ' selected';
|
|
159
|
+
that.value = next.getAttribute('data-val');
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
next = (key == 40) ? sel.nextSibling : sel.previousSibling;
|
|
163
|
+
if (next) {
|
|
164
|
+
sel.className = sel.className.replace('selected', '');
|
|
165
|
+
next.className += ' selected';
|
|
166
|
+
that.value = next.getAttribute('data-val');
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
sel.className = sel.className.replace('selected', '');
|
|
170
|
+
that.value = that.last_val;
|
|
171
|
+
next = 0;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
that.updateSC(0, next);
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
else if (key == 27) {
|
|
178
|
+
that.value = that.last_val;
|
|
179
|
+
that.sc.style.display = 'none';
|
|
180
|
+
}
|
|
181
|
+
else if (key == 13 || key == 9) {
|
|
182
|
+
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
183
|
+
if (sel && that.sc.style.display != 'none') {
|
|
184
|
+
o.onSelect(e, sel.getAttribute('data-val'), sel);
|
|
185
|
+
setTimeout(function () { that.sc.style.display = 'none'; }, 20);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
addEvent(that, 'keydown', that.keydownHandler);
|
|
190
|
+
that.keyupHandler = function (e) {
|
|
191
|
+
var key = window.event ? e.keyCode : e.which;
|
|
192
|
+
if (!key || (key < 35 || key > 40) && key != 13 && key != 27) {
|
|
193
|
+
var val = that.value;
|
|
194
|
+
if (val.length >= o.minChars) {
|
|
195
|
+
if (val != that.last_val) {
|
|
196
|
+
that.last_val = val;
|
|
197
|
+
clearTimeout(that.timer);
|
|
198
|
+
if (o.cache) {
|
|
199
|
+
if (val in that.cache) {
|
|
200
|
+
suggest(that.cache[val]);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
// no requests if previous suggestions were empty
|
|
204
|
+
for (var i = 1; i < val.length - o.minChars; i++) {
|
|
205
|
+
var part = val.slice(0, val.length - i);
|
|
206
|
+
if (part in that.cache && !that.cache[part].length) {
|
|
207
|
+
suggest([]);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
that.timer = setTimeout(function () { o.source(val, suggest); }, o.delay);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
that.last_val = val;
|
|
217
|
+
that.sc.style.display = 'none';
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
addEvent(that, 'keyup', that.keyupHandler);
|
|
222
|
+
that.focusHandler = function (e) {
|
|
223
|
+
that.last_val = '\n';
|
|
224
|
+
that.keyupHandler(e);
|
|
225
|
+
};
|
|
226
|
+
if (!o.minChars) {
|
|
227
|
+
addEvent(that, 'focus', that.focusHandler);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var suggest;
|
|
231
|
+
for (var i = 0; i < elems.length; i++) {
|
|
232
|
+
_loop_1(i);
|
|
233
|
+
}
|
|
234
|
+
// public destroy method
|
|
235
|
+
this.destroy = function () {
|
|
236
|
+
for (var i = 0; i < elems.length; i++) {
|
|
237
|
+
var that = elems[i];
|
|
238
|
+
removeEvent(window, 'resize', that.updateSC);
|
|
239
|
+
removeEvent(that, 'blur', that.blurHandler);
|
|
240
|
+
removeEvent(that, 'focus', that.focusHandler);
|
|
241
|
+
removeEvent(that, 'keydown', that.keydownHandler);
|
|
242
|
+
removeEvent(that, 'keyup', that.keyupHandler);
|
|
243
|
+
if (that.autocompleteAttr) {
|
|
244
|
+
that.setAttribute('autocomplete', that.autocompleteAttr);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
that.removeAttribute('autocomplete');
|
|
248
|
+
}
|
|
249
|
+
document.body.removeChild(that.sc);
|
|
250
|
+
that = null;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
return autoComplete;
|
|
255
|
+
})();
|
|
256
|
+
export function AutoSuggest(input, opts) {
|
|
257
|
+
return new autoComplete(__assign({ selector: input }, opts));
|
|
258
|
+
}
|
package/lib/ui/base.css
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* reset some browser inconsistencies */
|
|
2
|
+
|
|
3
|
+
html
|
|
4
|
+
{
|
|
5
|
+
/* line-height:1.15; */
|
|
6
|
+
-ms-text-size-adjust:100%;
|
|
7
|
+
-webkit-text-size-adjust:100%
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
hr
|
|
11
|
+
{
|
|
12
|
+
box-sizing:content-box;
|
|
13
|
+
height:0;
|
|
14
|
+
overflow:visible
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
pre,code
|
|
18
|
+
{
|
|
19
|
+
font-family:monospace,monospace;
|
|
20
|
+
font-size:1em
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
a
|
|
24
|
+
{
|
|
25
|
+
-webkit-text-decoration-skip:objects
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
sub,sup
|
|
29
|
+
{
|
|
30
|
+
font-size:75%;
|
|
31
|
+
line-height:0;
|
|
32
|
+
position:relative;
|
|
33
|
+
vertical-align:baseline
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
sub
|
|
37
|
+
{
|
|
38
|
+
bottom:-.25em
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
sup
|
|
42
|
+
{
|
|
43
|
+
top:-.5em
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
input,optgroup,select,textarea
|
|
47
|
+
{
|
|
48
|
+
font-size:100%;
|
|
49
|
+
line-height:1.15;
|
|
50
|
+
margin:0;
|
|
51
|
+
text-transform:none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
button,input
|
|
55
|
+
{
|
|
56
|
+
overflow:visible
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
button,html [type="button"],
|
|
60
|
+
[type="reset"],[type="submit"]
|
|
61
|
+
{
|
|
62
|
+
-webkit-appearance:button
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner
|
|
66
|
+
{
|
|
67
|
+
border-style:none;
|
|
68
|
+
padding:0
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring
|
|
72
|
+
{
|
|
73
|
+
outline:1px dotted ButtonText
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
textarea
|
|
77
|
+
{
|
|
78
|
+
overflow:auto
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
html {
|
|
83
|
+
color: #393939;
|
|
84
|
+
} */
|
|
85
|
+
|
|
86
|
+
/* html,input,textarea,button,optgroup,select {
|
|
87
|
+
font-family: Tahoma;
|
|
88
|
+
} */
|
|
89
|
+
|
|
90
|
+
.jsl-button {
|
|
91
|
+
background-color: #3B99FF;
|
|
92
|
+
border: 1px solid #3B99FF;
|
|
93
|
+
vertical-align:middle;
|
|
94
|
+
color: white;
|
|
95
|
+
|
|
96
|
+
border-radius: .3rem;
|
|
97
|
+
/* color: white; */
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
display: inline-block;
|
|
100
|
+
/* font-weight: 700; */
|
|
101
|
+
height: 2rem;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
letter-spacing: .1rem;
|
|
104
|
+
line-height: 2rem;
|
|
105
|
+
padding: 0rem 1.0rem;
|
|
106
|
+
text-align: center;
|
|
107
|
+
text-decoration: none;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.jsl-button.jsl-button-outline {
|
|
112
|
+
background: white;
|
|
113
|
+
color: #444444;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.jsl-button:active {
|
|
117
|
+
background-color: #3B99FF;
|
|
118
|
+
border-color:black;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.jsl-button:hover {
|
|
122
|
+
background-color: rgba(59, 154, 255, 0.5);
|
|
123
|
+
border-color: #C0C0C0;
|
|
124
|
+
color: black;
|
|
125
|
+
outline: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.jsl-button:focus {
|
|
129
|
+
outline: 0;
|
|
130
|
+
border-color: gray;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.jsl-button[disabled] {
|
|
134
|
+
cursor: default;
|
|
135
|
+
opacity: .5;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.right {
|
|
139
|
+
text-align: right;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.center {
|
|
143
|
+
text-align: center;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
div.jsl-fill {
|
|
147
|
+
height: 100%;
|
|
148
|
+
box-sizing: border-box;
|
|
149
|
+
position: relative;
|
|
150
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.dr-cals {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
background: white;
|
|
5
|
+
box-shadow: 8px 8px 32px -16px rgba(0, 0, 0, 0.5);
|
|
6
|
+
padding-top: 6px;
|
|
7
|
+
position: relative;
|
|
8
|
+
border-radius: 6px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dr-cals:before {
|
|
13
|
+
content: ' ';
|
|
14
|
+
height: 6px;
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
background: #3B99FF;
|
|
20
|
+
background: linear-gradient(-90deg, #3B99FF 0%, #8AEFC8 100%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dr-cals .dp-edge-day {
|
|
24
|
+
visibility: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dr-cals .dp-cal-footer {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dr-cals .dp {
|
|
32
|
+
border: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.dr-cals .dp-permanent {
|
|
36
|
+
max-width: 300px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dr-cals .dp-selected:focus,
|
|
40
|
+
.dr-cals .dp-selected,
|
|
41
|
+
.dr-cals .dp-current:focus,
|
|
42
|
+
.dr-cals .dp-current {
|
|
43
|
+
background: transparent;
|
|
44
|
+
color: inherit;
|
|
45
|
+
border-radius: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dr-cals .dp-day-disabled,
|
|
49
|
+
.dr-cals .dp-day-disabled:focus {
|
|
50
|
+
color: #DDD;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.dr-cal-end .dp {
|
|
54
|
+
border-left: 8px solid #F5F5F5;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.dr-cal-start .dp-next,
|
|
58
|
+
.dr-cal-end .dp-prev {
|
|
59
|
+
visibility: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.dr-cals .dp-current:hover,
|
|
63
|
+
.dr-cals .dr-in-range:hover,
|
|
64
|
+
.dr-cals .dr-in-range:focus,
|
|
65
|
+
.dr-cals .dr-in-range {
|
|
66
|
+
background: #75BCFC;
|
|
67
|
+
color: white;
|
|
68
|
+
border-radius: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.dr-cals .dr-selected:hover,
|
|
72
|
+
.dr-cals .dr-selected:focus,
|
|
73
|
+
.dr-cals .dr-selected {
|
|
74
|
+
background: #3B99FF;
|
|
75
|
+
color: white;
|
|
76
|
+
border-radius: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (max-width: 616px), (max-height: 480px) {
|
|
80
|
+
.dr-cal-end {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dr-cal-start .dp-next {
|
|
85
|
+
visibility: visible;
|
|
86
|
+
}
|
|
87
|
+
}
|