@tabler/core 1.0.0-beta17 → 1.0.0-beta19
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/README.md +23 -7
- package/dist/.DS_Store +0 -0
- package/dist/css/demo.css +13 -43
- package/dist/css/demo.min.css +3 -3
- package/dist/css/demo.rtl.css +13 -43
- package/dist/css/demo.rtl.min.css +3 -3
- package/dist/css/tabler-flags.css +5 -3
- package/dist/css/tabler-flags.min.css +3 -3
- package/dist/css/tabler-flags.rtl.css +5 -3
- package/dist/css/tabler-flags.rtl.min.css +3 -3
- package/dist/css/tabler-payments.css +12 -2
- package/dist/css/tabler-payments.min.css +3 -3
- package/dist/css/tabler-payments.rtl.css +12 -2
- package/dist/css/tabler-payments.rtl.min.css +3 -3
- package/dist/css/tabler-social.css +10 -0
- package/dist/css/tabler-social.min.css +8 -0
- package/dist/css/tabler-social.rtl.css +10 -0
- package/dist/css/tabler-social.rtl.min.css +8 -0
- package/dist/css/tabler-vendors.css +114 -38
- package/dist/css/tabler-vendors.min.css +3 -3
- package/dist/css/tabler-vendors.rtl.css +114 -38
- package/dist/css/tabler-vendors.rtl.min.css +3 -3
- package/dist/css/tabler.css +3831 -2185
- package/dist/css/tabler.min.css +7 -3
- package/dist/css/tabler.rtl.css +3831 -2186
- package/dist/css/tabler.rtl.min.css +7 -3
- package/dist/img/payments/epayco-dark.svg +1 -0
- package/dist/img/payments/epayco.svg +1 -0
- package/dist/js/demo-theme.js +9 -6
- package/dist/js/demo-theme.min.js +3 -3
- package/dist/js/demo.js +16 -16
- package/dist/js/demo.min.js +2 -2
- package/dist/js/tabler.esm.js +2115 -2970
- package/dist/js/tabler.esm.min.js +6 -6
- package/dist/js/tabler.js +2115 -2970
- package/dist/js/tabler.min.js +6 -6
- package/dist/libs/apexcharts/dist/apexcharts.amd.js +1 -1
- package/dist/libs/apexcharts/dist/apexcharts.common.js +5 -5
- package/dist/libs/apexcharts/dist/apexcharts.esm.js +5 -5
- package/dist/libs/apexcharts/dist/apexcharts.js +3010 -2741
- package/dist/libs/apexcharts/dist/apexcharts.min.js +5 -5
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +228 -228
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +196 -195
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.js +197 -196
- package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -1
- package/dist/libs/countup.js/dist/countUp.d.ts +8 -3
- package/dist/libs/countup.js/dist/countUp.js +26 -8
- package/dist/libs/countup.js/dist/countUp.min.js +1 -1
- package/dist/libs/countup.js/dist/countUp.umd.js +1 -293
- package/dist/libs/countup.js/dist/requestAnimationFrame.polyfill.js +26 -0
- package/dist/libs/fslightbox/README.md +39 -33
- package/dist/libs/fslightbox/index.js +1 -1
- package/dist/libs/fslightbox/package.json +10 -44
- package/dist/libs/jsvectormap/dist/js/jsvectormap.js +517 -857
- package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +1 -1
- package/dist/libs/nouislider/dist/nouislider.d.ts +2 -0
- package/dist/libs/nouislider/dist/nouislider.js +28 -0
- package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
- package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -1
- package/dist/libs/nouislider/dist/nouislider.mjs +28 -0
- package/dist/libs/plyr/dist/plyr.css +1 -1
- package/dist/libs/plyr/dist/plyr.js +289 -229
- package/dist/libs/plyr/dist/plyr.min.js +1 -1
- package/dist/libs/plyr/dist/plyr.min.js.map +1 -1
- package/dist/libs/plyr/dist/plyr.min.mjs +1 -1
- package/dist/libs/plyr/dist/plyr.min.mjs.map +1 -1
- package/dist/libs/plyr/dist/plyr.mjs +289 -229
- package/dist/libs/plyr/dist/plyr.polyfilled.js +289 -229
- package/dist/libs/plyr/dist/plyr.polyfilled.min.js +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.min.js.map +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs.map +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.mjs +289 -229
- package/dist/libs/star-rating.js/dist/star-rating.cjs.js +481 -0
- package/dist/libs/star-rating.js/dist/star-rating.css +220 -0
- package/dist/libs/star-rating.js/dist/star-rating.esm.js +479 -0
- package/dist/libs/star-rating.js/dist/star-rating.esm.min.js +1 -0
- package/dist/libs/star-rating.js/dist/star-rating.js +491 -0
- package/dist/libs/star-rating.js/dist/star-rating.min.css +8 -0
- package/dist/libs/star-rating.js/dist/star-rating.min.js +8 -0
- package/dist/libs/tinymce/CHANGELOG.md +112 -0
- package/dist/libs/tinymce/composer.json +1 -1
- package/dist/libs/tinymce/icons/default/icons.js +4 -0
- package/dist/libs/tinymce/icons/default/icons.min.js +1 -1
- package/dist/libs/tinymce/models/dom/model.js +79 -23
- package/dist/libs/tinymce/models/dom/model.min.js +2 -2
- package/dist/libs/tinymce/package.json +1 -1
- package/dist/libs/tinymce/plugins/advlist/plugin.js +34 -28
- package/dist/libs/tinymce/plugins/advlist/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/anchor/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/anchor/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/autolink/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/autolink/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/autoresize/plugin.js +46 -11
- package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/autosave/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/autosave/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/charmap/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/charmap/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/code/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/code/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/codesample/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/codesample/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/directionality/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/emoticons/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/fullscreen/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/help/plugin.js +12 -4
- package/dist/libs/tinymce/plugins/help/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/image/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/image/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/importcss/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/importcss/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/link/plugin.js +21 -7
- package/dist/libs/tinymce/plugins/link/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/lists/plugin.js +132 -50
- package/dist/libs/tinymce/plugins/lists/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/media/plugin.js +7 -2
- package/dist/libs/tinymce/plugins/media/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/pagebreak/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/preview/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/preview/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/quickbars/plugin.js +21 -13
- package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/save/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/save/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/searchreplace/plugin.js +56 -43
- package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/table/plugin.js +73 -55
- package/dist/libs/tinymce/plugins/table/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/template/plugin.js +17 -14
- package/dist/libs/tinymce/plugins/template/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/visualblocks/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/visualchars/plugin.js +58 -7
- package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/wordcount/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +1 -1
- package/dist/libs/tinymce/skins/ui/oxide/skin.css +454 -6
- package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +454 -6
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +455 -6
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +454 -5
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/dist/libs/tinymce/themes/silver/theme.js +4374 -3074
- package/dist/libs/tinymce/themes/silver/theme.min.js +2 -2
- package/dist/libs/tinymce/tinymce.d.ts +305 -236
- package/dist/libs/tinymce/tinymce.js +1957 -1597
- package/dist/libs/tinymce/tinymce.min.js +2 -2
- package/package.json +63 -42
- package/src/js/demo-theme.js +13 -10
- package/src/js/demo.js +18 -15
- package/src/js/tabler.esm.js +7 -8
- package/src/js/tabler.js +12 -12
- package/src/scss/_bootstrap-components.scss +33 -33
- package/src/scss/_bootstrap-config.scss +6 -6
- package/src/scss/_bootstrap-override.scss +8 -12
- package/src/scss/_config.scss +2 -1
- package/src/scss/_core.scss +1 -1
- package/src/scss/_debug.scss +41 -30
- package/src/scss/_utilities.scss +21 -19
- package/src/scss/_variables-dark.scss +17 -0
- package/src/scss/_variables.scss +233 -169
- package/src/scss/demo/_examples.scss +0 -16
- package/src/scss/demo.scss +36 -25
- package/src/scss/layout/_core.scss +0 -1
- package/src/scss/layout/_dark.scss +47 -162
- package/src/scss/layout/_navbar.scss +19 -99
- package/src/scss/layout/_page.scss +9 -6
- package/src/scss/layout/_root.scss +21 -7
- package/src/scss/mixins/_functions.scss +2 -6
- package/src/scss/mixins/_mixins.scss +0 -32
- package/src/scss/tabler-social.scss +1 -0
- package/src/scss/tabler-vendors.scss +1 -0
- package/src/scss/tabler.scss +0 -1
- package/src/scss/ui/_avatars.scss +1 -1
- package/src/scss/ui/_buttons.scss +1 -1
- package/src/scss/ui/_dropdowns.scss +1 -3
- package/src/scss/ui/_grid.scss +2 -18
- package/src/scss/ui/_payments.scss +1 -1
- package/src/scss/ui/_status.scss +0 -10
- package/src/scss/ui/_tables.scss +12 -26
- package/src/scss/ui/_timeline.scss +3 -3
- package/src/scss/utils/_colors.scss +6 -2
- package/src/scss/vendor/_apexcharts.scss +16 -0
- package/src/scss/vendor/_jsvectormap.scss +1 -1
- package/src/scss/vendor/_nouislider.scss +1 -1
- package/src/scss/vendor/_stars-rating.scss +20 -0
- package/src/scss/vendor/_tinymce.scss +5 -7
- package/src/scss/vendor/_tom-select.scss +43 -2
- package/dist/libs/countup.js/dist/countUp.withPolyfill.min.js +0 -1
- package/dist/libs/fslightbox/jest-setup.js +0 -1
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Star Rating
|
|
3
|
+
* @version: 4.3.0
|
|
4
|
+
* @author: Paul Ryley (http://geminilabs.io)
|
|
5
|
+
* @url: https://github.com/pryley/star-rating.js
|
|
6
|
+
* @license: MIT
|
|
7
|
+
*/
|
|
8
|
+
var StarRating = (function () {
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
function _classCallCheck(instance, Constructor) {
|
|
12
|
+
if (!(instance instanceof Constructor)) {
|
|
13
|
+
throw new TypeError("Cannot call a class as a function");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _defineProperties(target, props) {
|
|
18
|
+
for (var i = 0; i < props.length; i++) {
|
|
19
|
+
var descriptor = props[i];
|
|
20
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
21
|
+
descriptor.configurable = true;
|
|
22
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
23
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
28
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
29
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
30
|
+
return Constructor;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var defaults = {
|
|
34
|
+
classNames: {
|
|
35
|
+
active: 'gl-active',
|
|
36
|
+
base: 'gl-star-rating',
|
|
37
|
+
selected: 'gl-selected'
|
|
38
|
+
},
|
|
39
|
+
clearable: true,
|
|
40
|
+
maxStars: 10,
|
|
41
|
+
prebuilt: false,
|
|
42
|
+
stars: null,
|
|
43
|
+
tooltip: 'Select a Rating'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var addRemoveClass = function addRemoveClass(el, bool, className) {
|
|
47
|
+
el.classList[bool ? 'add' : 'remove'](className);
|
|
48
|
+
};
|
|
49
|
+
var createSpanEl = function createSpanEl(attributes) {
|
|
50
|
+
var el = document.createElement('span');
|
|
51
|
+
attributes = attributes || {};
|
|
52
|
+
|
|
53
|
+
for (var key in attributes) {
|
|
54
|
+
el.setAttribute(key, attributes[key]);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return el;
|
|
58
|
+
};
|
|
59
|
+
var inRange = function inRange(value, min, max) {
|
|
60
|
+
return /^\d+$/.test(value) && min <= value && value <= max;
|
|
61
|
+
};
|
|
62
|
+
var insertSpanEl = function insertSpanEl(el, after, attributes) {
|
|
63
|
+
var newEl = createSpanEl(attributes);
|
|
64
|
+
el.parentNode.insertBefore(newEl, after ? el.nextSibling : el);
|
|
65
|
+
return newEl;
|
|
66
|
+
};
|
|
67
|
+
var merge = function merge() {
|
|
68
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
69
|
+
args[_key] = arguments[_key];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// adapted from https://github.com/firstandthird/aug
|
|
73
|
+
var results = {};
|
|
74
|
+
args.forEach(function (prop) {
|
|
75
|
+
Object.keys(prop || {}).forEach(function (propName) {
|
|
76
|
+
if (args[0][propName] === undefined) return; // restrict keys to the defaults
|
|
77
|
+
|
|
78
|
+
var propValue = prop[propName];
|
|
79
|
+
|
|
80
|
+
if (type(propValue) === 'Object' && type(results[propName]) === 'Object') {
|
|
81
|
+
results[propName] = merge(results[propName], propValue);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
results[propName] = propValue;
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
return results;
|
|
89
|
+
};
|
|
90
|
+
var type = function type(value) {
|
|
91
|
+
return {}.toString.call(value).slice(8, -1);
|
|
92
|
+
};
|
|
93
|
+
var values = function values(selectEl) {
|
|
94
|
+
var values = [];
|
|
95
|
+
[].forEach.call(selectEl.options, function (el) {
|
|
96
|
+
var value = parseInt(el.value, 10) || 0;
|
|
97
|
+
|
|
98
|
+
if (value > 0) {
|
|
99
|
+
values.push({
|
|
100
|
+
index: el.index,
|
|
101
|
+
text: el.text,
|
|
102
|
+
value: value
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return values.sort(function (a, b) {
|
|
107
|
+
return a.value - b.value;
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var Widget = /*#__PURE__*/function () {
|
|
112
|
+
function Widget(el, props) {
|
|
113
|
+
_classCallCheck(this, Widget);
|
|
114
|
+
|
|
115
|
+
// (HTMLElement, object):void
|
|
116
|
+
this.direction = window.getComputedStyle(el, null).getPropertyValue('direction');
|
|
117
|
+
this.el = el;
|
|
118
|
+
this.events = {
|
|
119
|
+
change: this.onChange.bind(this),
|
|
120
|
+
keydown: this.onKeyDown.bind(this),
|
|
121
|
+
mousedown: this.onPointerDown.bind(this),
|
|
122
|
+
mouseleave: this.onPointerLeave.bind(this),
|
|
123
|
+
mousemove: this.onPointerMove.bind(this),
|
|
124
|
+
reset: this.onReset.bind(this),
|
|
125
|
+
touchend: this.onPointerDown.bind(this),
|
|
126
|
+
touchmove: this.onPointerMove.bind(this)
|
|
127
|
+
};
|
|
128
|
+
this.indexActive = null; // the active span index
|
|
129
|
+
|
|
130
|
+
this.indexSelected = null; // the selected span index
|
|
131
|
+
|
|
132
|
+
this.props = props;
|
|
133
|
+
this.tick = null;
|
|
134
|
+
this.ticking = false;
|
|
135
|
+
this.values = values(el);
|
|
136
|
+
this.widgetEl = null;
|
|
137
|
+
|
|
138
|
+
if (this.el.widget) {
|
|
139
|
+
this.el.widget.destroy(); // remove any stale event listeners
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (inRange(this.values.length, 1, this.props.maxStars)) {
|
|
143
|
+
this.build();
|
|
144
|
+
} else {
|
|
145
|
+
this.destroy();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
_createClass(Widget, [{
|
|
150
|
+
key: "build",
|
|
151
|
+
value: function build() {
|
|
152
|
+
// ():void
|
|
153
|
+
this.destroy();
|
|
154
|
+
this.buildWidget();
|
|
155
|
+
this.selectValue(this.indexSelected = this.selected(), false); // set the initial value but do not trigger change event
|
|
156
|
+
|
|
157
|
+
this.handleEvents('add');
|
|
158
|
+
this.el.widget = this; // store a reference to this widget on the SELECT so that we can remove stale event listeners
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
key: "buildWidget",
|
|
162
|
+
value: function buildWidget() {
|
|
163
|
+
var _this = this;
|
|
164
|
+
|
|
165
|
+
// ():void
|
|
166
|
+
var parentEl, widgetEl;
|
|
167
|
+
|
|
168
|
+
if (this.props.prebuilt) {
|
|
169
|
+
parentEl = this.el.parentNode;
|
|
170
|
+
widgetEl = parentEl.querySelector('.' + this.props.classNames.base + '--stars');
|
|
171
|
+
} else {
|
|
172
|
+
parentEl = insertSpanEl(this.el, false, {
|
|
173
|
+
"class": this.props.classNames.base
|
|
174
|
+
});
|
|
175
|
+
parentEl.appendChild(this.el);
|
|
176
|
+
widgetEl = insertSpanEl(this.el, true, {
|
|
177
|
+
"class": this.props.classNames.base + '--stars'
|
|
178
|
+
});
|
|
179
|
+
this.values.forEach(function (item, index) {
|
|
180
|
+
var el = createSpanEl({
|
|
181
|
+
'data-index': index,
|
|
182
|
+
'data-value': item.value
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
if ('function' === typeof _this.props.stars) {
|
|
186
|
+
_this.props.stars.call(_this, el, item, index);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
[].forEach.call(el.children, function (el) {
|
|
190
|
+
return el.style.pointerEvents = 'none';
|
|
191
|
+
});
|
|
192
|
+
widgetEl.innerHTML += el.outerHTML;
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
parentEl.dataset.starRating = '';
|
|
197
|
+
parentEl.classList.add(this.props.classNames.base + '--' + this.direction);
|
|
198
|
+
|
|
199
|
+
if (this.props.tooltip) {
|
|
200
|
+
widgetEl.setAttribute('role', 'tooltip');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
this.widgetEl = widgetEl;
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "changeIndexTo",
|
|
207
|
+
value: function changeIndexTo(index, force) {
|
|
208
|
+
var _this2 = this;
|
|
209
|
+
|
|
210
|
+
// (int):void
|
|
211
|
+
if (this.indexActive !== index || force) {
|
|
212
|
+
[].forEach.call(this.widgetEl.children, function (el, i) {
|
|
213
|
+
// i starts at zero
|
|
214
|
+
addRemoveClass(el, i <= index, _this2.props.classNames.active);
|
|
215
|
+
addRemoveClass(el, i === _this2.indexSelected, _this2.props.classNames.selected);
|
|
216
|
+
});
|
|
217
|
+
this.widgetEl.setAttribute('data-rating', index + 1);
|
|
218
|
+
|
|
219
|
+
if ('function' !== typeof this.props.stars && !this.props.prebuilt) {
|
|
220
|
+
// @v3 compat
|
|
221
|
+
this.widgetEl.classList.remove('s' + 10 * (this.indexActive + 1));
|
|
222
|
+
this.widgetEl.classList.add('s' + 10 * (index + 1));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (this.props.tooltip) {
|
|
226
|
+
var _this$values$index;
|
|
227
|
+
|
|
228
|
+
var label = index < 0 ? this.props.tooltip : (_this$values$index = this.values[index]) === null || _this$values$index === void 0 ? void 0 : _this$values$index.text;
|
|
229
|
+
this.widgetEl.setAttribute('aria-label', label);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
this.indexActive = index;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
this.ticking = false;
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "destroy",
|
|
239
|
+
value: function destroy() {
|
|
240
|
+
// ():void
|
|
241
|
+
this.indexActive = null; // the active span index
|
|
242
|
+
|
|
243
|
+
this.indexSelected = this.selected(); // the selected span index
|
|
244
|
+
|
|
245
|
+
var parentEl = this.el.parentNode;
|
|
246
|
+
|
|
247
|
+
if (parentEl.classList.contains(this.props.classNames.base)) {
|
|
248
|
+
if (this.props.prebuilt) {
|
|
249
|
+
this.widgetEl = parentEl.querySelector('.' + this.props.classNames.base + '--stars');
|
|
250
|
+
parentEl.classList.remove(this.props.classNames.base + '--' + this.direction);
|
|
251
|
+
delete parentEl.dataset.starRating;
|
|
252
|
+
} else {
|
|
253
|
+
parentEl.parentNode.replaceChild(this.el, parentEl);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
this.handleEvents('remove');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
delete this.el.widget; // remove the widget reference
|
|
260
|
+
}
|
|
261
|
+
}, {
|
|
262
|
+
key: "eventListener",
|
|
263
|
+
value: function eventListener(el, action, events, items) {
|
|
264
|
+
var _this3 = this;
|
|
265
|
+
|
|
266
|
+
// (HTMLElement, string, array, object):void
|
|
267
|
+
events.forEach(function (ev) {
|
|
268
|
+
return el[action + 'EventListener'](ev, _this3.events[ev], items || false);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
key: "handleEvents",
|
|
273
|
+
value: function handleEvents(action) {
|
|
274
|
+
// (string):void
|
|
275
|
+
var formEl = this.el.closest('form');
|
|
276
|
+
|
|
277
|
+
if (formEl && formEl.tagName === 'FORM') {
|
|
278
|
+
this.eventListener(formEl, action, ['reset']);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
this.eventListener(this.el, action, ['change']); // always trigger the change event, even when SELECT is disabled
|
|
282
|
+
|
|
283
|
+
if ('add' === action && this.el.disabled) return;
|
|
284
|
+
this.eventListener(this.el, action, ['keydown']);
|
|
285
|
+
this.eventListener(this.widgetEl, action, ['mousedown', 'mouseleave', 'mousemove', 'touchend', 'touchmove'], false);
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
key: "indexFromEvent",
|
|
289
|
+
value: function indexFromEvent(ev) {
|
|
290
|
+
var _ev$touches, _ev$changedTouches;
|
|
291
|
+
|
|
292
|
+
// (MouseEvent|TouchEvent):void
|
|
293
|
+
var origin = ((_ev$touches = ev.touches) === null || _ev$touches === void 0 ? void 0 : _ev$touches[0]) || ((_ev$changedTouches = ev.changedTouches) === null || _ev$changedTouches === void 0 ? void 0 : _ev$changedTouches[0]) || ev;
|
|
294
|
+
var el = document.elementFromPoint(origin.clientX, origin.clientY);
|
|
295
|
+
|
|
296
|
+
if (el.parentNode === this.widgetEl) {
|
|
297
|
+
return [].slice.call(el.parentNode.children).indexOf(el);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return this.indexActive;
|
|
301
|
+
}
|
|
302
|
+
}, {
|
|
303
|
+
key: "onChange",
|
|
304
|
+
value: function onChange() {
|
|
305
|
+
// ():void
|
|
306
|
+
this.changeIndexTo(this.selected(), true);
|
|
307
|
+
}
|
|
308
|
+
}, {
|
|
309
|
+
key: "onKeyDown",
|
|
310
|
+
value: function onKeyDown(ev) {
|
|
311
|
+
// (KeyboardEvent):void
|
|
312
|
+
var key = ev.key.slice(5);
|
|
313
|
+
if (!~['Left', 'Right'].indexOf(key)) return;
|
|
314
|
+
ev.preventDefault();
|
|
315
|
+
var increment = key === 'Left' ? -1 : 1;
|
|
316
|
+
|
|
317
|
+
if (this.direction === 'rtl') {
|
|
318
|
+
increment *= -1;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
var maxIndex = this.values.length - 1;
|
|
322
|
+
var minIndex = -1;
|
|
323
|
+
var index = Math.min(Math.max(this.selected() + increment, minIndex), maxIndex);
|
|
324
|
+
this.selectValue(index, true); // trigger change event
|
|
325
|
+
}
|
|
326
|
+
}, {
|
|
327
|
+
key: "onPointerDown",
|
|
328
|
+
value: function onPointerDown(ev) {
|
|
329
|
+
// (MouseEvent|TouchEvent):void
|
|
330
|
+
ev.preventDefault(); // this.el.focus(); // highlight the rating field
|
|
331
|
+
|
|
332
|
+
var index = this.indexFromEvent(ev);
|
|
333
|
+
|
|
334
|
+
if (this.props.clearable && index === this.indexSelected) {
|
|
335
|
+
index = -1; // remove the value
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
this.selectValue(index, true); // trigger change event
|
|
339
|
+
}
|
|
340
|
+
}, {
|
|
341
|
+
key: "onPointerLeave",
|
|
342
|
+
value: function onPointerLeave(ev) {
|
|
343
|
+
var _this4 = this;
|
|
344
|
+
|
|
345
|
+
// (MouseEvent):void
|
|
346
|
+
ev.preventDefault();
|
|
347
|
+
cancelAnimationFrame(this.tick);
|
|
348
|
+
requestAnimationFrame(function () {
|
|
349
|
+
return _this4.changeIndexTo(_this4.indexSelected);
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
key: "onPointerMove",
|
|
354
|
+
value: function onPointerMove(ev) {
|
|
355
|
+
var _this5 = this;
|
|
356
|
+
|
|
357
|
+
// (MouseEvent|TouchEvent):void
|
|
358
|
+
ev.preventDefault();
|
|
359
|
+
|
|
360
|
+
if (!this.ticking) {
|
|
361
|
+
this.tick = requestAnimationFrame(function () {
|
|
362
|
+
return _this5.changeIndexTo(_this5.indexFromEvent(ev));
|
|
363
|
+
});
|
|
364
|
+
this.ticking = true;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}, {
|
|
368
|
+
key: "onReset",
|
|
369
|
+
value: function onReset() {
|
|
370
|
+
var _this$el$querySelecto;
|
|
371
|
+
|
|
372
|
+
// ():void
|
|
373
|
+
var index = this.valueIndex((_this$el$querySelecto = this.el.querySelector('[selected]')) === null || _this$el$querySelecto === void 0 ? void 0 : _this$el$querySelecto.value);
|
|
374
|
+
this.selectValue(index || -1, false); // do not trigger change event
|
|
375
|
+
}
|
|
376
|
+
}, {
|
|
377
|
+
key: "selected",
|
|
378
|
+
value: function selected() {
|
|
379
|
+
// ():int
|
|
380
|
+
return this.valueIndex(this.el.value); // get the selected span index
|
|
381
|
+
}
|
|
382
|
+
}, {
|
|
383
|
+
key: "selectValue",
|
|
384
|
+
value: function selectValue(index, triggerChangeEvent) {
|
|
385
|
+
var _this$values$index2;
|
|
386
|
+
|
|
387
|
+
// (int, bool):void
|
|
388
|
+
this.el.value = ((_this$values$index2 = this.values[index]) === null || _this$values$index2 === void 0 ? void 0 : _this$values$index2.value) || ''; // first set the new value
|
|
389
|
+
|
|
390
|
+
this.indexSelected = this.selected(); // get the actual index from the selected value
|
|
391
|
+
|
|
392
|
+
if (false === triggerChangeEvent) {
|
|
393
|
+
this.changeIndexTo(this.selected(), true);
|
|
394
|
+
} else {
|
|
395
|
+
this.el.dispatchEvent(new Event('change'));
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}, {
|
|
399
|
+
key: "valueIndex",
|
|
400
|
+
value: function valueIndex(value) {
|
|
401
|
+
return this.values.findIndex(function (val) {
|
|
402
|
+
return val.value === +value;
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}]);
|
|
406
|
+
|
|
407
|
+
return Widget;
|
|
408
|
+
}();
|
|
409
|
+
|
|
410
|
+
var StarRating = /*#__PURE__*/function () {
|
|
411
|
+
function StarRating(selector, props) {
|
|
412
|
+
_classCallCheck(this, StarRating);
|
|
413
|
+
|
|
414
|
+
// (HTMLSelectElement|NodeList|string, object):void
|
|
415
|
+
this.destroy = this.destroy.bind(this);
|
|
416
|
+
this.props = props;
|
|
417
|
+
this.rebuild = this.rebuild.bind(this);
|
|
418
|
+
this.selector = selector;
|
|
419
|
+
this.widgets = [];
|
|
420
|
+
this.build();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
_createClass(StarRating, [{
|
|
424
|
+
key: "build",
|
|
425
|
+
value: function build() {
|
|
426
|
+
var _this = this;
|
|
427
|
+
|
|
428
|
+
// (HTMLSelectElement|NodeList|string, object):void
|
|
429
|
+
this.queryElements(this.selector).forEach(function (el) {
|
|
430
|
+
var options = merge(defaults, _this.props, JSON.parse(el.getAttribute('data-options')));
|
|
431
|
+
|
|
432
|
+
if ('SELECT' === el.tagName && !el.widget) {
|
|
433
|
+
// check for an existing Widget reference
|
|
434
|
+
if (!options.prebuilt && el.parentNode.classList.contains(options.classNames.base)) {
|
|
435
|
+
_this.unwrap(el);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
_this.widgets.push(new Widget(el, options));
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}, {
|
|
443
|
+
key: "destroy",
|
|
444
|
+
value: function destroy() {
|
|
445
|
+
// ():void
|
|
446
|
+
this.widgets.forEach(function (widget) {
|
|
447
|
+
return widget.destroy();
|
|
448
|
+
});
|
|
449
|
+
this.widgets = [];
|
|
450
|
+
}
|
|
451
|
+
}, {
|
|
452
|
+
key: "queryElements",
|
|
453
|
+
value: function queryElements(selector) {
|
|
454
|
+
// (HTMLSelectElement|NodeList|string):array
|
|
455
|
+
if ('HTMLSelectElement' === type(selector)) {
|
|
456
|
+
return [selector];
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if ('NodeList' === type(selector)) {
|
|
460
|
+
return [].slice.call(selector);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if ('String' === type(selector)) {
|
|
464
|
+
return [].slice.call(document.querySelectorAll(selector));
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return [];
|
|
468
|
+
}
|
|
469
|
+
}, {
|
|
470
|
+
key: "rebuild",
|
|
471
|
+
value: function rebuild() {
|
|
472
|
+
// ():void
|
|
473
|
+
this.destroy();
|
|
474
|
+
this.build();
|
|
475
|
+
}
|
|
476
|
+
}, {
|
|
477
|
+
key: "unwrap",
|
|
478
|
+
value: function unwrap(el) {
|
|
479
|
+
var removeEl = el.parentNode;
|
|
480
|
+
var parentEl = removeEl.parentNode;
|
|
481
|
+
parentEl.insertBefore(el, removeEl);
|
|
482
|
+
parentEl.removeChild(removeEl);
|
|
483
|
+
}
|
|
484
|
+
}]);
|
|
485
|
+
|
|
486
|
+
return StarRating;
|
|
487
|
+
}();
|
|
488
|
+
|
|
489
|
+
return StarRating;
|
|
490
|
+
|
|
491
|
+
}());
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Star Rating
|
|
3
|
+
* @version: 4.3.0
|
|
4
|
+
* @author: Paul Ryley (http://geminilabs.io)
|
|
5
|
+
* @url: https://github.com/pryley/star-rating.js
|
|
6
|
+
* @license: MIT
|
|
7
|
+
*/
|
|
8
|
+
:root{--gl-star-color:#fdd835;--gl-star-color-inactive:#dcdce6;--gl-star-empty:url(../img/star-empty.svg);--gl-star-full:url(../img/star-full.svg);--gl-star-size:24px;--gl-tooltip-border-radius:4px;--gl-tooltip-font-size:0.875rem;--gl-tooltip-font-weight:400;--gl-tooltip-line-height:1;--gl-tooltip-margin:12px;--gl-tooltip-padding:.5em 1em;--gl-tooltip-size:6px}[data-star-rating]>select{-webkit-clip-path:circle(1px at 0 0)!important;clip-path:circle(1px at 0 0)!important;clip:rect(1px,1px,1px,1px)!important;height:1px!important;margin:0!important;overflow:hidden!important;padding:0!important;position:absolute!important;top:0!important;visibility:visible!important;white-space:nowrap!important;width:1px!important;-webkit-appearance:none;-moz-appearance:none;appearance:none;pointer-events:none}[data-star-rating]>select:after,[data-star-rating]>select:before{display:none!important}[data-star-rating].gl-star-rating--ltr>select{left:0!important}[data-star-rating].gl-star-rating--rtl>select{right:0!important}[data-star-rating]{align-items:center;display:flex;position:relative}.gl-star-rating:not([data-star-rating]) .gl-star-rating--stars{display:none}[data-star-rating] .gl-star-rating--stars{align-items:center;cursor:pointer;display:flex;position:relative}[data-star-rating]>select:focus+.gl-star-rating--stars span:first-child:before{box-shadow:0 0 0 3px -moz-mac-focusring;box-shadow:0 0 0 3px -webkit-focus-ring-color;box-shadow:0 0 0 3px Highlight;content:"";display:block;height:100%;outline:1px solid transparent;pointer-events:none;position:absolute;width:100%}[data-star-rating] select[disabled]+.gl-star-rating--stars{cursor:default}[data-star-rating] .gl-star-rating--stars>span{display:flex;height:24px;height:var(--gl-star-size);margin:0;width:24px;width:var(--gl-star-size)}[data-star-rating] .gl-star-rating--stars[aria-label]:after,[data-star-rating] .gl-star-rating--stars[aria-label]:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;bottom:auto;box-sizing:border-box;left:100%;pointer-events:none;position:absolute;top:50%;opacity:.9;transform-origin:top;transform:translate3d(0,-50%,0);white-space:nowrap;z-index:10}[data-star-rating] .gl-star-rating--stars[aria-label]:before{background-size:100% auto!important;background-position:50%!important;background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 31'%3E%3Cpath fill='%23111' d='M12.002 31C12.002 25 0 19.838 0 15.5 0 11.24 12 6 12 0l.002 31z'/%3E%3C/svg%3E") no-repeat;content:"";height:18px;margin-bottom:0;margin-left:6px;margin-left:var(--gl-tooltip-size);width:6px;width:var(--gl-tooltip-size)}[data-star-rating] .gl-star-rating--stars[aria-label]:after{background:#111;border-radius:4px;border-radius:var(--gl-tooltip-border-radius);color:#fff;content:attr(aria-label);font-size:.875rem;font-size:var(--gl-tooltip-font-size);font-weight:400;margin-left:12px;margin-left:var(--gl-tooltip-margin);padding:.5em 1em;padding:var(--gl-tooltip-padding);text-transform:none}[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]:after,[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]:before{left:auto;right:100%}[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]:before{transform:scaleX(-1) translate3d(0,-50%,0);margin-left:0;margin-right:6px;margin-right:var(--gl-tooltip-size)}[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]:after{margin-left:0;margin-right:12px;margin-right:var(--gl-tooltip-margin)}[data-star-rating] svg{height:100%;width:100%}[data-star-rating] .gl-star-half{fill:none;stroke:none}[data-star-rating] .gl-star-full{fill:#dcdce6;fill:var(--gl-star-color-inactive);stroke:#dcdce6;stroke:var(--gl-star-color-inactive);transition:fill .15s ease-in-out,stroke .15s ease-in-out}[data-star-rating] .gl-active .gl-star-full{fill:#fdd835;fill:var(--gl-star-color);stroke:#fdd835;stroke:var(--gl-star-color)}.gl-star-rating--stars[class*=" s"]>span{background-image:url(../img/star-empty.svg)!important;background-image:var(--gl-star-empty)!important;background-position:50%;background-repeat:no-repeat;background-size:90%}.gl-star-rating--stars[class*=" s"]>span.gl-active,.gl-star-rating--stars[class*=" s"]>span.gl-active.gl-selected{background-image:url(../img/star-full.svg)!important;background-image:var(--gl-star-full)!important}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Star Rating
|
|
3
|
+
* @version: 4.3.0
|
|
4
|
+
* @author: Paul Ryley (http://geminilabs.io)
|
|
5
|
+
* @url: https://github.com/pryley/star-rating.js
|
|
6
|
+
* @license: MIT
|
|
7
|
+
*/
|
|
8
|
+
var StarRating=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function i(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}var s={classNames:{active:"gl-active",base:"gl-star-rating",selected:"gl-selected"},clearable:!0,maxStars:10,prebuilt:!1,stars:null,tooltip:"Select a Rating"},n=function(e,t,i){e.classList[t?"add":"remove"](i)},a=function(e){var t=document.createElement("span");for(var i in e=e||{})t.setAttribute(i,e[i]);return t},l=function(e,t,i){var s=a(i);return e.parentNode.insertBefore(s,t?e.nextSibling:e),s},r=function e(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];var n={};return i.forEach((function(t){Object.keys(t||{}).forEach((function(s){if(void 0!==i[0][s]){var a=t[s];"Object"!==o(a)||"Object"!==o(n[s])?n[s]=a:n[s]=e(n[s],a)}}))})),n},o=function(e){return{}.toString.call(e).slice(8,-1)},u=function(){function t(i,s){var n,a,l;e(this,t),this.direction=window.getComputedStyle(i,null).getPropertyValue("direction"),this.el=i,this.events={change:this.onChange.bind(this),keydown:this.onKeyDown.bind(this),mousedown:this.onPointerDown.bind(this),mouseleave:this.onPointerLeave.bind(this),mousemove:this.onPointerMove.bind(this),reset:this.onReset.bind(this),touchend:this.onPointerDown.bind(this),touchmove:this.onPointerMove.bind(this)},this.indexActive=null,this.indexSelected=null,this.props=s,this.tick=null,this.ticking=!1,this.values=function(e){var t=[];return[].forEach.call(e.options,(function(e){var i=parseInt(e.value,10)||0;i>0&&t.push({index:e.index,text:e.text,value:i})})),t.sort((function(e,t){return e.value-t.value}))}(i),this.widgetEl=null,this.el.widget&&this.el.widget.destroy(),n=this.values.length,a=1,l=this.props.maxStars,/^\d+$/.test(n)&&a<=n&&n<=l?this.build():this.destroy()}return i(t,[{key:"build",value:function(){this.destroy(),this.buildWidget(),this.selectValue(this.indexSelected=this.selected(),!1),this.handleEvents("add"),this.el.widget=this}},{key:"buildWidget",value:function(){var e,t,i=this;this.props.prebuilt?(e=this.el.parentNode,t=e.querySelector("."+this.props.classNames.base+"--stars")):((e=l(this.el,!1,{class:this.props.classNames.base})).appendChild(this.el),t=l(this.el,!0,{class:this.props.classNames.base+"--stars"}),this.values.forEach((function(e,s){var n=a({"data-index":s,"data-value":e.value});"function"==typeof i.props.stars&&i.props.stars.call(i,n,e,s),[].forEach.call(n.children,(function(e){return e.style.pointerEvents="none"})),t.innerHTML+=n.outerHTML}))),e.dataset.starRating="",e.classList.add(this.props.classNames.base+"--"+this.direction),this.props.tooltip&&t.setAttribute("role","tooltip"),this.widgetEl=t}},{key:"changeIndexTo",value:function(e,t){var i=this;if(this.indexActive!==e||t){if([].forEach.call(this.widgetEl.children,(function(t,s){n(t,s<=e,i.props.classNames.active),n(t,s===i.indexSelected,i.props.classNames.selected)})),this.widgetEl.setAttribute("data-rating",e+1),"function"==typeof this.props.stars||this.props.prebuilt||(this.widgetEl.classList.remove("s"+10*(this.indexActive+1)),this.widgetEl.classList.add("s"+10*(e+1))),this.props.tooltip){var s,a=e<0?this.props.tooltip:null===(s=this.values[e])||void 0===s?void 0:s.text;this.widgetEl.setAttribute("aria-label",a)}this.indexActive=e}this.ticking=!1}},{key:"destroy",value:function(){this.indexActive=null,this.indexSelected=this.selected();var e=this.el.parentNode;e.classList.contains(this.props.classNames.base)&&(this.props.prebuilt?(this.widgetEl=e.querySelector("."+this.props.classNames.base+"--stars"),e.classList.remove(this.props.classNames.base+"--"+this.direction),delete e.dataset.starRating):e.parentNode.replaceChild(this.el,e),this.handleEvents("remove")),delete this.el.widget}},{key:"eventListener",value:function(e,t,i,s){var n=this;i.forEach((function(i){return e[t+"EventListener"](i,n.events[i],s||!1)}))}},{key:"handleEvents",value:function(e){var t=this.el.closest("form");t&&"FORM"===t.tagName&&this.eventListener(t,e,["reset"]),this.eventListener(this.el,e,["change"]),"add"===e&&this.el.disabled||(this.eventListener(this.el,e,["keydown"]),this.eventListener(this.widgetEl,e,["mousedown","mouseleave","mousemove","touchend","touchmove"],!1))}},{key:"indexFromEvent",value:function(e){var t,i,s=(null===(t=e.touches)||void 0===t?void 0:t[0])||(null===(i=e.changedTouches)||void 0===i?void 0:i[0])||e,n=document.elementFromPoint(s.clientX,s.clientY);return n.parentNode===this.widgetEl?[].slice.call(n.parentNode.children).indexOf(n):this.indexActive}},{key:"onChange",value:function(){this.changeIndexTo(this.selected(),!0)}},{key:"onKeyDown",value:function(e){var t=e.key.slice(5);if(~["Left","Right"].indexOf(t)){e.preventDefault();var i="Left"===t?-1:1;"rtl"===this.direction&&(i*=-1);var s=this.values.length-1,n=Math.min(Math.max(this.selected()+i,-1),s);this.selectValue(n,!0)}}},{key:"onPointerDown",value:function(e){e.preventDefault();var t=this.indexFromEvent(e);this.props.clearable&&t===this.indexSelected&&(t=-1),this.selectValue(t,!0)}},{key:"onPointerLeave",value:function(e){var t=this;e.preventDefault(),cancelAnimationFrame(this.tick),requestAnimationFrame((function(){return t.changeIndexTo(t.indexSelected)}))}},{key:"onPointerMove",value:function(e){var t=this;e.preventDefault(),this.ticking||(this.tick=requestAnimationFrame((function(){return t.changeIndexTo(t.indexFromEvent(e))})),this.ticking=!0)}},{key:"onReset",value:function(){var e,t=this.valueIndex(null===(e=this.el.querySelector("[selected]"))||void 0===e?void 0:e.value);this.selectValue(t||-1,!1)}},{key:"selected",value:function(){return this.valueIndex(this.el.value)}},{key:"selectValue",value:function(e,t){var i;this.el.value=(null===(i=this.values[e])||void 0===i?void 0:i.value)||"",this.indexSelected=this.selected(),!1===t?this.changeIndexTo(this.selected(),!0):this.el.dispatchEvent(new Event("change"))}},{key:"valueIndex",value:function(e){return this.values.findIndex((function(t){return t.value===+e}))}}]),t}();return function(){function t(i,s){e(this,t),this.destroy=this.destroy.bind(this),this.props=s,this.rebuild=this.rebuild.bind(this),this.selector=i,this.widgets=[],this.build()}return i(t,[{key:"build",value:function(){var e=this;this.queryElements(this.selector).forEach((function(t){var i=r(s,e.props,JSON.parse(t.getAttribute("data-options")));"SELECT"!==t.tagName||t.widget||(!i.prebuilt&&t.parentNode.classList.contains(i.classNames.base)&&e.unwrap(t),e.widgets.push(new u(t,i)))}))}},{key:"destroy",value:function(){this.widgets.forEach((function(e){return e.destroy()})),this.widgets=[]}},{key:"queryElements",value:function(e){return"HTMLSelectElement"===o(e)?[e]:"NodeList"===o(e)?[].slice.call(e):"String"===o(e)?[].slice.call(document.querySelectorAll(e)):[]}},{key:"rebuild",value:function(){this.destroy(),this.build()}},{key:"unwrap",value:function(e){var t=e.parentNode,i=t.parentNode;i.insertBefore(e,t),i.removeChild(t)}}]),t}()}();
|
|
@@ -6,6 +6,117 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 6.4.2 - 2023-04-26
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- The editor would display a notification error when it fails to retirieve a blob image uri. #TINY-9604
|
|
13
|
+
- Menu buttons would have the Tabstopping behaviour in toolbar. #TINY-9723
|
|
14
|
+
- The `urlinput` dialog component would not open the typeahead dropdown when the input value was reset to an empty string. #TINY-9717
|
|
15
|
+
- Redial would in some situations cause select elements not to have an initial value selected when they should have. #TINY-9679
|
|
16
|
+
- Fixed the mouse pointer style from a text cursor to a default arrow pointer when hovering over the tree dialog component items. #TINY-9692
|
|
17
|
+
- Enabled variant of togglable `tox-button` and `tox-button--secondary` now supports `hover`/`active`/`focus`/`disabled` states. #TINY-9713
|
|
18
|
+
- Setting an invalid unit in the `fontsizeinput` would change it do the default value instead of reverting it back to the previous valid value. #TINY-9754
|
|
19
|
+
- Selection was not correctly scrolled horizontally into view when using the `selection.scrollIntoView` API. #TINY-9747
|
|
20
|
+
- Context toolbars displayed the incorrect status for the `advlist` plugin buttons. #TINY-9680
|
|
21
|
+
- The image would not be inserted when using the `quickimage` button on Chrome. #TINY-9769
|
|
22
|
+
|
|
23
|
+
## 6.4.1 - 2023-03-29
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- The `fontsizeinput` increase and decrease size buttons now work on TinyMCE mobile. #TINY-9725
|
|
27
|
+
- The TinyMCE editor toolbar is now accessible for all screen widths; it no longer collapses into an inaccessible vertical line when the screen is scrolled horizontally. #TINY-9646
|
|
28
|
+
- Reverted the changes made, in TinyMCE 6.4.0, to UI button colors in focus, active, and enabled states. #TINY-9176
|
|
29
|
+
|
|
30
|
+
## 6.4.0 - 2023-03-15
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- New `tree` component that can be used in dialog body panel. #TINY-9532
|
|
34
|
+
- `renderUI` property in the `Theme` type can now return a `Promise<RenderResult>` instead of `RenderResult`. #TINY-9556
|
|
35
|
+
- New `isEditable` API to `editor.selection` that returns true or false if the current selection is editable. #TINY-9462
|
|
36
|
+
- New `isEditable` API to `editor.dom` that returns true or false if the specified node is editable. #TINY-9462
|
|
37
|
+
- New `setText` and `setIcon` methods added to menu button and toolbar button API. #TINY-9268
|
|
38
|
+
- New `highlight_on_focus` option which enables highlighting the content area on focus. #TINY-9277
|
|
39
|
+
- New `fontsizeinput` toolbar item which allows the user to set the size via input and also increase and decrease it with `+` and `-` buttons. #TINY-9429
|
|
40
|
+
- Added `skipFocus` option to the `ToggleToolbarDrawer` command to preserve focus. #TINY-9337
|
|
41
|
+
- New `font_size_input_default_unit` option allows entry of numbers without a unit in `fontsizeinput`. They are then parsed as the set unit. If `font_size_input_default_unit` is not set the default is `pt`. #TINY-9585
|
|
42
|
+
- New `group` and `togglebutton` in view. #TINY-9523
|
|
43
|
+
- New `togglebutton` in dialog footer buttons. #TINY-9523
|
|
44
|
+
- Added `toggleFullscreen` to dialog API. #TINY-9528
|
|
45
|
+
- New `text-size-increase` and `text-size-decrease` icons. #TINY-9530
|
|
46
|
+
- New `xss_sanitization` option to allow disabling of XSS sanitization. #TINY-9600
|
|
47
|
+
- Added the top right close button of modal dialogs to the tabbing order. The 'x' button in these dialogs can now be accessed using keyboard navigation. #TINY-9520
|
|
48
|
+
- New `ui_mode` option for editor in scrollable containers support. #TINY-9414
|
|
49
|
+
- The sidebar element now has the accessibility role `region` when visible and the accessibility role `presentation` when hidden. #TINY-9517
|
|
50
|
+
- The `tox-custom-editor` class now has a border highlight when it is selected. #TINY-9673
|
|
51
|
+
- An element could be dropped onto the decendants of an element with a `contenteditable="false"` attribute. #TINY-9364
|
|
52
|
+
- Checkmark did not show in menu color swatches. #TINY-9395
|
|
53
|
+
- Add support for navigating inside the tree component using arrow keys and shift key. #TINY-9614
|
|
54
|
+
|
|
55
|
+
### Improved
|
|
56
|
+
- Direct invalid child text nodes of list elements are now wrapped in list item elements. #TINY-4818
|
|
57
|
+
- Templates are now be parsed before preview and insertion to make preview consistent with inserted template content and prevent XSS. #TINY-9244
|
|
58
|
+
- Pressing backspace on an empty line now preserves formatting on the previous empty line. #TINY-9454
|
|
59
|
+
- Pressing enter inside the `inputfontsize` input field now moves focus back into the editor content. #TINY-9598
|
|
60
|
+
- Drag and drop events for elements with a `contenteditable="false"` attribute now includes target element details. #TINY-9599
|
|
61
|
+
- Updated focus, active, and enabled colors of UI buttons for improved contrast against the UI color. #TINY-9176
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- The `link` plugins context menu items no longer appears for links that include elements with a `contenteditable="false"` attribute. #TINY-9491
|
|
65
|
+
- The formatting of elements with a `contenteditable="false"` attribute are no longer cloned to new cells when new table rows are created. #TINY-9449
|
|
66
|
+
- Changed the color of `@dialog-table-border-color`, and added right padding to the first cell of dialog table. #TINY-9380
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
- Sometimes the editor would finish initializing before the silver theme would have finished loading. #TINY-9556
|
|
70
|
+
- The `searchreplace` modal closed incorrectly when clicking outside of the alert that pops up when no match is found. #TINY-9443
|
|
71
|
+
- The text color or background color picker toolbar buttons did not update when the text color or background color was changed using the equivalent commands in the Format menu. #TINY-9439
|
|
72
|
+
- The `onSetup` api function would not run when defining custom group toolbar button. #TINY-9496
|
|
73
|
+
- The foreground and background menu icons would not properly update to display the last used color. #TINY-9497
|
|
74
|
+
- Added new `setIconFill` function to `NestedMenuItemInstanceApi`. #TINY-9497
|
|
75
|
+
- Pasting links to text would sometimes not generate the correct undo stack in Safari. #TINY-9489
|
|
76
|
+
- Toolbar split buttons in `advlist` plugin now show the correct state when the cursor is in a checklist. #TINY-5167
|
|
77
|
+
- Dragging transparent elements into transparent block elements could produce invalid nesting of transparents. #TINY-9231
|
|
78
|
+
- The `editor.insertContent` API would insert contents inside elements with a `contenteditable="false"` attribute if the selection was inside the element. #TINY-9462
|
|
79
|
+
- Closing a dialog would scroll down the document in Safari. #TINY-9148
|
|
80
|
+
- Inline headers would not work in some situations when the editor was moved too far right horizontally. #TINY-8977
|
|
81
|
+
- Quick toolbars were incorrectly rendered during the dragging of elements with a `contenteditable="false"` attribute. #TINY-9305
|
|
82
|
+
- Selection of images, horizontal rules, tables or elements with a `contenteditable="false"` attribute was possible if they were within an element with a `contenteditable="false"` attribute. #TINY-9473
|
|
83
|
+
- Ranged deletion of formatted text using selection or a keyboard shortcut would sometimes cause Blink- and Webkit-based browsers to insert interpreted tags upon typing. This could result in inconsistent tags. #TINY-9302
|
|
84
|
+
- Visual characters were rendered inside elements with a `contenteditable="false"` attribute. #TINY-9474
|
|
85
|
+
- Lists with an element with a `contenteditable="false"` attribute as their root were incorrectly editable using list API commands, toolbar buttons and menu items. #TINY-9458
|
|
86
|
+
- Color picker dialog would not update the preview color if the hex input value was prefixed with the `#` character. #TINY-9457
|
|
87
|
+
- Table cell selection was possible even if the element being selected was within an element with a `contenteditable="false"` attribute. #TINY-9459
|
|
88
|
+
- Table commands were modifying tables that were within an element with a `contenteditable="false"` attribute. #TINY-9459
|
|
89
|
+
- Fake carets were rendered for elements with a `contenteditable="false"` attribute and for tables within an element with a `contenteditable="false"` attribute. #TINY-9459
|
|
90
|
+
- Textareas with scrollbars in dialogs would not render rounded corners correctly on some browsers. #TINY-9331
|
|
91
|
+
- It was possible to open links inside the editor if the editor root was an element with a `contenteditable="false"` attribute. #TINY-9470
|
|
92
|
+
- Inline boundary was rendered for boundary elements that had a `contenteditable="false"` attribute. #TINY-9471
|
|
93
|
+
- Clicking on a disabled split button will no longer call the `onAction` callback. #TINY-9504
|
|
94
|
+
- The *Edit Link* dialog incorrectly retrieved the URL value when opened immediately after the link insertion. #TINY-7993
|
|
95
|
+
- The `ForwardDelete` and `Delete` editor commands were deleting content within elements with a `contenteditable="false"` attribute. #TINY-9477
|
|
96
|
+
- The Backspace and Forward Delete keys were deleting content within elements with a `contenteditable="false"` attribute. #TINY-9477
|
|
97
|
+
- Inserting newlines inside an editable element that was inside an element with a `contenteditable="false"` attribute root would sometimes try to split the editable element. #TINY-9461
|
|
98
|
+
- Creating a list in a table cell when the caret is in front of an anchor element would not properly include the anchor in the list. #TINY-6853
|
|
99
|
+
- Dragging and dropping elements with a `contenteditable="false"` attribute on table borders would remove the element on drop. #TINY-9021
|
|
100
|
+
- Elements with a `contenteditable="false"` attribute would be removed when dragged and dropped within a root element with a `contenteditable="false"` attribute. #TINY-9558
|
|
101
|
+
- Formatting could be applied or removed to list items with a `contenteditable="false"` attribute that were inside an element with a `contenteditable="false"` attribute. #TINY-9563
|
|
102
|
+
- Annotation were not removed if the annotation was deleted immediately after being created. #TINY-9399
|
|
103
|
+
- Inserting a link for a selection from quickbars did not preserve formatting. #TINY-9593
|
|
104
|
+
- Inline dialog position was not correct when the editor was not inline and was contained in a `fixed` or `absolute` positioned element. #TINY-9554
|
|
105
|
+
- Sticky toolbars did not fade transition when undocking in classic iframe mode. #TINY-9408
|
|
106
|
+
- Inserting elements that were not valid within the closest editing host would incorrectly split the editing host. #TINY-9595
|
|
107
|
+
- The `color_cols` option was not respected in the `forecolor` or `backcolor` color swatches. #TINY-9560
|
|
108
|
+
- Drag and dropping the last element with a `contenteditable="false"` attribute out of its parent block would not properly pad the parent block element. #TINY-9606
|
|
109
|
+
- Applying heading formats from `text_patterns` produced an invisible space before a word. #TINY-9603
|
|
110
|
+
- Opening color swatches caused the browser tab to crash when `color_cols` or other column option was set to 0. #TINY-9649
|
|
111
|
+
- Opening a menu button in the footer of a dialog after a redial threw an error. #TINY-9686
|
|
112
|
+
- After closing a view, the `more...` toolbar button disappeared if the editor had `toolbar_mode: 'sliding'` and the toolbar was opened. #TINY-9419
|
|
113
|
+
- Inline dialogs would open partially off screen when the toolbar had a small width. #TINY-9588
|
|
114
|
+
|
|
115
|
+
## 6.3.2 - 2023-02-22
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
- Removed a workaround for ensuring stylesheets are loaded in an outdated version of webkit. #TINY-9433
|
|
119
|
+
|
|
9
120
|
## 6.3.1 - 2022-12-06
|
|
10
121
|
|
|
11
122
|
### Fixed
|
|
@@ -54,6 +165,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
54
165
|
- A newline could not be inserted when the selection was restored from a bookmark after an inline element with a `contenteditable="false"` attribute. #TINY-9194
|
|
55
166
|
- The global `tinymce.dom.styleSheetLoader` was not affected by the `content_css_cors` option. #TINY-6037
|
|
56
167
|
- The caret was moved to the previous line when a text pattern executed a `mceInsertContent` command on Enter key when running on Firefox. #TINY-9193
|
|
168
|
+
- The `autoresize` plugin used to cause infinite resize when `content_css` is set to `document`. #TINY-8872
|
|
57
169
|
|
|
58
170
|
## 6.2.0 - 2022-09-08
|
|
59
171
|
|