@tabler/core 1.0.0-beta18 → 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.
Files changed (46) hide show
  1. package/dist/css/demo.css +2 -2
  2. package/dist/css/demo.min.css +2 -2
  3. package/dist/css/demo.rtl.css +2 -2
  4. package/dist/css/demo.rtl.min.css +2 -2
  5. package/dist/css/tabler-flags.css +2 -2
  6. package/dist/css/tabler-flags.min.css +2 -2
  7. package/dist/css/tabler-flags.rtl.css +2 -2
  8. package/dist/css/tabler-flags.rtl.min.css +2 -2
  9. package/dist/css/tabler-payments.css +2 -2
  10. package/dist/css/tabler-payments.min.css +2 -2
  11. package/dist/css/tabler-payments.rtl.css +2 -2
  12. package/dist/css/tabler-payments.rtl.min.css +2 -2
  13. package/dist/css/tabler-social.css +2 -2
  14. package/dist/css/tabler-social.min.css +2 -2
  15. package/dist/css/tabler-social.rtl.css +2 -2
  16. package/dist/css/tabler-social.rtl.min.css +2 -2
  17. package/dist/css/tabler-vendors.css +19 -2
  18. package/dist/css/tabler-vendors.min.css +3 -3
  19. package/dist/css/tabler-vendors.rtl.css +19 -2
  20. package/dist/css/tabler-vendors.rtl.min.css +3 -3
  21. package/dist/css/tabler.css +36 -31
  22. package/dist/css/tabler.min.css +4 -4
  23. package/dist/css/tabler.rtl.css +36 -31
  24. package/dist/css/tabler.rtl.min.css +4 -4
  25. package/dist/js/demo-theme.js +2 -2
  26. package/dist/js/demo-theme.min.js +2 -2
  27. package/dist/js/demo.js +2 -2
  28. package/dist/js/demo.min.js +2 -2
  29. package/dist/js/tabler.esm.js +2 -2
  30. package/dist/js/tabler.esm.min.js +3 -3
  31. package/dist/js/tabler.js +2 -2
  32. package/dist/js/tabler.min.js +4 -4
  33. package/dist/libs/star-rating.js/dist/star-rating.cjs.js +481 -0
  34. package/dist/libs/star-rating.js/dist/star-rating.css +220 -0
  35. package/dist/libs/star-rating.js/dist/star-rating.esm.js +479 -0
  36. package/dist/libs/star-rating.js/dist/star-rating.esm.min.js +1 -0
  37. package/dist/libs/star-rating.js/dist/star-rating.js +491 -0
  38. package/dist/libs/star-rating.js/dist/star-rating.min.css +8 -0
  39. package/dist/libs/star-rating.js/dist/star-rating.min.js +8 -0
  40. package/package.json +9 -3
  41. package/src/scss/_variables.scss +1 -1
  42. package/src/scss/layout/_navbar.scss +1 -70
  43. package/src/scss/tabler-vendors.scss +1 -0
  44. package/src/scss/ui/_grid.scss +2 -2
  45. package/src/scss/ui/_tables.scss +12 -11
  46. package/src/scss/vendor/_stars-rating.scss +20 -0
@@ -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}()}();
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@tabler/core",
3
- "version": "1.0.0-beta18",
3
+ "version": "1.0.0-beta19",
4
4
  "description": "Premium and Open Source dashboard template with responsive and high quality UI.",
5
5
  "homepage": "https://tabler.io",
6
6
  "scripts": {
7
+ "dev": "pnpm run start-plugins",
7
8
  "start": "gulp start",
8
9
  "start-plugins": "gulp start --with-plugins",
9
10
  "build": "gulp build",
@@ -184,7 +185,8 @@
184
185
  "vinyl-buffer": "^1.0.1",
185
186
  "vinyl-source-stream": "^2.0.0",
186
187
  "yaml": "^2.2.2",
187
- "yargs": "^17.7.2"
188
+ "yargs": "^17.7.2",
189
+ "star-rating.js": "^4.3.0"
188
190
  },
189
191
  "dependencies": {
190
192
  "@popperjs/core": "^2.11.7",
@@ -205,7 +207,8 @@
205
207
  "nouislider": "^15.7.0",
206
208
  "plyr": "^3.7.8",
207
209
  "tinymce": "^6.4.2",
208
- "tom-select": "^2.2.2"
210
+ "tom-select": "^2.2.2",
211
+ "star-rating.js": "^4.3.0"
209
212
  },
210
213
  "peerDependenciesMeta": {
211
214
  "apexcharts": {
@@ -252,6 +255,9 @@
252
255
  },
253
256
  "tom-select": {
254
257
  "optional": true
258
+ },
259
+ "star-rating.js": {
260
+ "optional": true
255
261
  }
256
262
  },
257
263
  "release-it": {
@@ -823,7 +823,7 @@ $input-border-color-translucent: var(
823
823
  ) !default;
824
824
  $input-placeholder-color: $text-muted-light !default;
825
825
 
826
- $input-group-addon-bg: $light !default;
826
+ $input-group-addon-bg: var(--#{$prefix}bg-surface-secondary) !default;
827
827
  $input-group-addon-color: var(--#{$prefix}muted) !default;
828
828
 
829
829
  $input-border-radius: var(--#{$prefix}border-radius) !default;
@@ -1,65 +1,3 @@
1
- //@mixin navbar-color($bg-color: transparent, $color: $navbar-light-color, $brand-color: $navbar-light-brand-color, $link-active-color: $navbar-light-active-color, $link-disabled-color: $navbar-light-disabled-color, $link-active-bg: $navbar-light-active-bg) {
2
- // --#{$prefix}navbar-active-bg: #{$link-active-bg};
3
- // --#{$prefix}navbar-bg: #{$bg-color};
4
- // color: $color;
5
- //
6
- // .navbar-brand {
7
- // color: $brand-color;
8
- //
9
- // &:hover,
10
- // &:focus {
11
- // color: $brand-color;
12
- // opacity: .8;
13
- // }
14
- // }
15
- //
16
- // .navbar-nav {
17
- // .nav-link {
18
- // color: $color;
19
- //
20
- // &:hover,
21
- // &:focus {
22
- // color: $link-active-color;
23
- // }
24
- //
25
- // &.disabled {
26
- // color: $link-disabled-color;
27
- // }
28
- // }
29
- //
30
- // .show > .nav-link,
31
- // .active > .nav-link,
32
- // .nav-link.show,
33
- // .nav-link.active {
34
- // color: $link-active-color;
35
- // }
36
- // }
37
- //
38
- // .navbar-toggler {
39
- // color: $brand-color;
40
- // border-color: transparent;
41
- // }
42
- //
43
- // .navbar-text {
44
- // color: $color;
45
- //
46
- // a,
47
- // a:hover,
48
- // a:focus {
49
- // color: $color;
50
- // }
51
- // }
52
- //}
53
-
54
- @mixin navbar-dark {
55
- --#{$prefix}navbar-bg: #{$dark};
56
- --#{$prefix}scrollbar-color: var(--#{$prefix}white-rgb);
57
- --#{$prefix}navbar-color: var(--#{$prefix}gray-400);
58
-
59
- @each $color, $value in $theme-colors {
60
- --#{$prefix}#{$color}-lt-rgb: #{to-rgb(theme-color-lighter($value, $dark))};
61
- }
62
- }
63
1
 
64
2
  @mixin navbar-vertical-nav {
65
3
  .navbar-collapse {
@@ -139,7 +77,7 @@ Navbar
139
77
  --#{$prefix}navbar-border-width: #{$navbar-border-width};
140
78
  --#{$prefix}navbar-active-border-color: #{$navbar-active-border-color};
141
79
  --#{$prefix}navbar-active-bg: #{$navbar-light-active-bg};
142
- --#{$prefix}navbar-color: inherit;
80
+ --#{$prefix}navbar-color: var(--#{$prefix}body-color);
143
81
  --#{$prefix}navbar-border-color: #{$navbar-border-color};
144
82
  align-items: stretch;
145
83
  min-height: $navbar-height;
@@ -317,13 +255,6 @@ Navbar toggler
317
255
  }
318
256
  }
319
257
 
320
- // /**
321
- // Navbar dark
322
- // */
323
- // .navbar-dark {
324
- // @include navbar-dark;
325
- // }
326
-
327
258
  /**
328
259
  Navbar transparent
329
260
  */
@@ -9,3 +9,4 @@
9
9
  @import "vendor/fslightbox";
10
10
  @import "vendor/plyr";
11
11
  @import "vendor/tinymce";
12
+ @import "vendor/stars-rating";
@@ -74,7 +74,7 @@
74
74
 
75
75
  .divide-y#{$name-prefixed} {
76
76
  > :not(template) ~ :not(template) {
77
- border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) $border-color-translucent !important;
77
+ border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color-translucent) !important;
78
78
  }
79
79
 
80
80
  > :not(template):not(:first-child) {
@@ -88,7 +88,7 @@
88
88
 
89
89
  .divide-x#{$name-prefixed} {
90
90
  > :not(template) ~ :not(template) {
91
- border-left: var(--#{$prefix}border-width) var(--#{$prefix}border-style) $border-color-translucent !important;
91
+ border-left: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color-translucent) !important;
92
92
  }
93
93
 
94
94
  > :not(template):not(:first-child) {