@pageboard/html 0.14.19 → 0.14.20

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 (109) hide show
  1. package/elements/accordion.js +1 -1
  2. package/elements/fieldsets.js +1 -1
  3. package/elements/form.js +2 -2
  4. package/elements/grid.js +1 -1
  5. package/elements/image.js +1 -1
  6. package/elements/input-file.js +2 -2
  7. package/elements/input-property.js +1 -1
  8. package/elements/inputs.js +5 -5
  9. package/elements/layout.js +1 -1
  10. package/elements/link.js +2 -2
  11. package/elements/menu.js +2 -2
  12. package/elements/navigation.js +1 -1
  13. package/elements/page.js +1 -1
  14. package/elements/paragraph.js +2 -2
  15. package/elements/query-tags.js +1 -1
  16. package/elements/tab.js +1 -1
  17. package/elements/table.js +1 -1
  18. package/elements/template.js +1 -1
  19. package/package.json +3 -8
  20. package/ui/card.css +3 -3
  21. package/ui/components/accordion.css +241 -0
  22. package/ui/components/accordion.js +613 -0
  23. package/ui/components/ad.css +275 -0
  24. package/ui/components/api.js +1167 -0
  25. package/ui/components/breadcrumb.css +122 -0
  26. package/ui/components/button.css +3525 -0
  27. package/ui/components/card.css +939 -0
  28. package/ui/components/checkbox.css +604 -0
  29. package/ui/components/checkbox.js +831 -0
  30. package/ui/components/colorize.js +274 -0
  31. package/ui/components/comment.css +268 -0
  32. package/ui/components/container.css +149 -0
  33. package/ui/components/dimmer.css +224 -0
  34. package/ui/components/dimmer.js +733 -0
  35. package/ui/components/divider.css +253 -0
  36. package/ui/components/dropdown.css +1448 -0
  37. package/ui/components/dropdown.js +3955 -0
  38. package/ui/components/embed.css +160 -0
  39. package/ui/components/embed.js +706 -0
  40. package/ui/components/feed.css +281 -0
  41. package/ui/components/flag.css +1035 -0
  42. package/ui/components/form.css +1011 -0
  43. package/ui/components/form.js +1706 -0
  44. package/ui/components/grid.css +1941 -0
  45. package/ui/components/header.css +719 -0
  46. package/ui/components/icon.css +4777 -0
  47. package/ui/components/image.css +310 -0
  48. package/ui/components/input.css +469 -0
  49. package/ui/components/item.css +464 -0
  50. package/ui/components/label.css +1281 -0
  51. package/ui/components/list.css +943 -0
  52. package/ui/components/loader.css +339 -0
  53. package/ui/components/menu.css +1940 -0
  54. package/ui/components/message.css +468 -0
  55. package/ui/components/modal.css +617 -0
  56. package/ui/components/modal.js +1034 -0
  57. package/ui/components/nag.css +145 -0
  58. package/ui/components/nag.js +507 -0
  59. package/ui/components/placeholder.css +229 -0
  60. package/ui/components/popup.css +640 -0
  61. package/ui/components/popup.js +1532 -0
  62. package/ui/components/progress.css +502 -0
  63. package/ui/components/progress.js +931 -0
  64. package/ui/components/rail.css +152 -0
  65. package/ui/components/rating.css +257 -0
  66. package/ui/components/rating.js +508 -0
  67. package/ui/components/reset.css +476 -0
  68. package/ui/components/reveal.css +260 -0
  69. package/ui/components/search.css +431 -0
  70. package/ui/components/search.js +1505 -0
  71. package/ui/components/segment.css +824 -0
  72. package/ui/components/shape.css +143 -0
  73. package/ui/components/shape.js +921 -0
  74. package/ui/components/sidebar.css +537 -0
  75. package/ui/components/sidebar.js +1033 -0
  76. package/ui/components/site.css +184 -0
  77. package/ui/components/site.js +487 -0
  78. package/ui/components/state.js +708 -0
  79. package/ui/components/statistic.css +534 -0
  80. package/ui/components/step.css +566 -0
  81. package/ui/components/sticky.css +73 -0
  82. package/ui/components/sticky.js +959 -0
  83. package/ui/components/tab.css +89 -0
  84. package/ui/components/tab.js +952 -0
  85. package/ui/components/table.css +1108 -0
  86. package/ui/components/transition.css +1792 -0
  87. package/ui/components/transition.js +1095 -0
  88. package/ui/components/video.css +121 -0
  89. package/ui/components/video.js +532 -0
  90. package/ui/components/visibility.js +1311 -0
  91. package/ui/components/visit.js +517 -0
  92. package/ui/item.css +2 -2
  93. package/ui/themes/default/assets/fonts/brand-icons.eot +0 -0
  94. package/ui/themes/default/assets/fonts/brand-icons.svg +1008 -0
  95. package/ui/themes/default/assets/fonts/brand-icons.ttf +0 -0
  96. package/ui/themes/default/assets/fonts/brand-icons.woff +0 -0
  97. package/ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  98. package/ui/themes/default/assets/fonts/icons.eot +0 -0
  99. package/ui/themes/default/assets/fonts/icons.otf +0 -0
  100. package/ui/themes/default/assets/fonts/icons.svg +1518 -0
  101. package/ui/themes/default/assets/fonts/icons.ttf +0 -0
  102. package/ui/themes/default/assets/fonts/icons.woff +0 -0
  103. package/ui/themes/default/assets/fonts/icons.woff2 +0 -0
  104. package/ui/themes/default/assets/fonts/outline-icons.eot +0 -0
  105. package/ui/themes/default/assets/fonts/outline-icons.svg +366 -0
  106. package/ui/themes/default/assets/fonts/outline-icons.ttf +0 -0
  107. package/ui/themes/default/assets/fonts/outline-icons.woff +0 -0
  108. package/ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  109. package/ui/themes/default/assets/images/flags.png +0 -0
@@ -0,0 +1,508 @@
1
+ /*!
2
+ * # Semantic UI 2.4.1 - Rating
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Released under the MIT license
7
+ * http://opensource.org/licenses/MIT
8
+ *
9
+ */
10
+
11
+ ;(function ($, window, document, undefined) {
12
+
13
+ 'use strict';
14
+
15
+ window = (typeof window != 'undefined' && window.Math == Math)
16
+ ? window
17
+ : (typeof self != 'undefined' && self.Math == Math)
18
+ ? self
19
+ : Function('return this')()
20
+ ;
21
+
22
+ $.fn.rating = function(parameters) {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
26
+
27
+ time = new Date().getTime(),
28
+ performance = [],
29
+
30
+ query = arguments[0],
31
+ methodInvoked = (typeof query == 'string'),
32
+ queryArguments = [].slice.call(arguments, 1),
33
+ returnedValue
34
+ ;
35
+ $allModules
36
+ .each(function() {
37
+ var
38
+ settings = ( $.isPlainObject(parameters) )
39
+ ? $.extend(true, {}, $.fn.rating.settings, parameters)
40
+ : $.extend({}, $.fn.rating.settings),
41
+
42
+ namespace = settings.namespace,
43
+ className = settings.className,
44
+ metadata = settings.metadata,
45
+ selector = settings.selector,
46
+ error = settings.error,
47
+
48
+ eventNamespace = '.' + namespace,
49
+ moduleNamespace = 'module-' + namespace,
50
+
51
+ element = this,
52
+ instance = $(this).data(moduleNamespace),
53
+
54
+ $module = $(this),
55
+ $icon = $module.find(selector.icon),
56
+
57
+ initialLoad,
58
+ module
59
+ ;
60
+
61
+ module = {
62
+
63
+ initialize: function() {
64
+ module.verbose('Initializing rating module', settings);
65
+
66
+ if($icon.length === 0) {
67
+ module.setup.layout();
68
+ }
69
+
70
+ if(settings.interactive) {
71
+ module.enable();
72
+ }
73
+ else {
74
+ module.disable();
75
+ }
76
+ module.set.initialLoad();
77
+ module.set.rating( module.get.initialRating() );
78
+ module.remove.initialLoad();
79
+ module.instantiate();
80
+ },
81
+
82
+ instantiate: function() {
83
+ module.verbose('Instantiating module', settings);
84
+ instance = module;
85
+ $module
86
+ .data(moduleNamespace, module)
87
+ ;
88
+ },
89
+
90
+ destroy: function() {
91
+ module.verbose('Destroying previous instance', instance);
92
+ module.remove.events();
93
+ $module
94
+ .removeData(moduleNamespace)
95
+ ;
96
+ },
97
+
98
+ refresh: function() {
99
+ $icon = $module.find(selector.icon);
100
+ },
101
+
102
+ setup: {
103
+ layout: function() {
104
+ var
105
+ maxRating = module.get.maxRating(),
106
+ html = $.fn.rating.settings.templates.icon(maxRating)
107
+ ;
108
+ module.debug('Generating icon html dynamically');
109
+ $module
110
+ .html(html)
111
+ ;
112
+ module.refresh();
113
+ }
114
+ },
115
+
116
+ event: {
117
+ mouseenter: function() {
118
+ var
119
+ $activeIcon = $(this)
120
+ ;
121
+ $activeIcon
122
+ .nextAll()
123
+ .removeClass(className.selected)
124
+ ;
125
+ $module
126
+ .addClass(className.selected)
127
+ ;
128
+ $activeIcon
129
+ .addClass(className.selected)
130
+ .prevAll()
131
+ .addClass(className.selected)
132
+ ;
133
+ },
134
+ mouseleave: function() {
135
+ $module
136
+ .removeClass(className.selected)
137
+ ;
138
+ $icon
139
+ .removeClass(className.selected)
140
+ ;
141
+ },
142
+ click: function() {
143
+ var
144
+ $activeIcon = $(this),
145
+ currentRating = module.get.rating(),
146
+ rating = $icon.index($activeIcon) + 1,
147
+ canClear = (settings.clearable == 'auto')
148
+ ? ($icon.length === 1)
149
+ : settings.clearable
150
+ ;
151
+ if(canClear && currentRating == rating) {
152
+ module.clearRating();
153
+ }
154
+ else {
155
+ module.set.rating( rating );
156
+ }
157
+ }
158
+ },
159
+
160
+ clearRating: function() {
161
+ module.debug('Clearing current rating');
162
+ module.set.rating(0);
163
+ },
164
+
165
+ bind: {
166
+ events: function() {
167
+ module.verbose('Binding events');
168
+ $module
169
+ .on('mouseenter' + eventNamespace, selector.icon, module.event.mouseenter)
170
+ .on('mouseleave' + eventNamespace, selector.icon, module.event.mouseleave)
171
+ .on('click' + eventNamespace, selector.icon, module.event.click)
172
+ ;
173
+ }
174
+ },
175
+
176
+ remove: {
177
+ events: function() {
178
+ module.verbose('Removing events');
179
+ $module
180
+ .off(eventNamespace)
181
+ ;
182
+ },
183
+ initialLoad: function() {
184
+ initialLoad = false;
185
+ }
186
+ },
187
+
188
+ enable: function() {
189
+ module.debug('Setting rating to interactive mode');
190
+ module.bind.events();
191
+ $module
192
+ .removeClass(className.disabled)
193
+ ;
194
+ },
195
+
196
+ disable: function() {
197
+ module.debug('Setting rating to read-only mode');
198
+ module.remove.events();
199
+ $module
200
+ .addClass(className.disabled)
201
+ ;
202
+ },
203
+
204
+ is: {
205
+ initialLoad: function() {
206
+ return initialLoad;
207
+ }
208
+ },
209
+
210
+ get: {
211
+ initialRating: function() {
212
+ if($module.data(metadata.rating) !== undefined) {
213
+ $module.removeData(metadata.rating);
214
+ return $module.data(metadata.rating);
215
+ }
216
+ return settings.initialRating;
217
+ },
218
+ maxRating: function() {
219
+ if($module.data(metadata.maxRating) !== undefined) {
220
+ $module.removeData(metadata.maxRating);
221
+ return $module.data(metadata.maxRating);
222
+ }
223
+ return settings.maxRating;
224
+ },
225
+ rating: function() {
226
+ var
227
+ currentRating = $icon.filter('.' + className.active).length
228
+ ;
229
+ module.verbose('Current rating retrieved', currentRating);
230
+ return currentRating;
231
+ }
232
+ },
233
+
234
+ set: {
235
+ rating: function(rating) {
236
+ var
237
+ ratingIndex = (rating - 1 >= 0)
238
+ ? (rating - 1)
239
+ : 0,
240
+ $activeIcon = $icon.eq(ratingIndex)
241
+ ;
242
+ $module
243
+ .removeClass(className.selected)
244
+ ;
245
+ $icon
246
+ .removeClass(className.selected)
247
+ .removeClass(className.active)
248
+ ;
249
+ if(rating > 0) {
250
+ module.verbose('Setting current rating to', rating);
251
+ $activeIcon
252
+ .prevAll()
253
+ .addBack()
254
+ .addClass(className.active)
255
+ ;
256
+ }
257
+ if(!module.is.initialLoad()) {
258
+ settings.onRate.call(element, rating);
259
+ }
260
+ },
261
+ initialLoad: function() {
262
+ initialLoad = true;
263
+ }
264
+ },
265
+
266
+ setting: function(name, value) {
267
+ module.debug('Changing setting', name, value);
268
+ if( $.isPlainObject(name) ) {
269
+ $.extend(true, settings, name);
270
+ }
271
+ else if(value !== undefined) {
272
+ if($.isPlainObject(settings[name])) {
273
+ $.extend(true, settings[name], value);
274
+ }
275
+ else {
276
+ settings[name] = value;
277
+ }
278
+ }
279
+ else {
280
+ return settings[name];
281
+ }
282
+ },
283
+ internal: function(name, value) {
284
+ if( $.isPlainObject(name) ) {
285
+ $.extend(true, module, name);
286
+ }
287
+ else if(value !== undefined) {
288
+ module[name] = value;
289
+ }
290
+ else {
291
+ return module[name];
292
+ }
293
+ },
294
+ debug: function() {
295
+ if(!settings.silent && settings.debug) {
296
+ if(settings.performance) {
297
+ module.performance.log(arguments);
298
+ }
299
+ else {
300
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
301
+ module.debug.apply(console, arguments);
302
+ }
303
+ }
304
+ },
305
+ verbose: function() {
306
+ if(!settings.silent && settings.verbose && settings.debug) {
307
+ if(settings.performance) {
308
+ module.performance.log(arguments);
309
+ }
310
+ else {
311
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
312
+ module.verbose.apply(console, arguments);
313
+ }
314
+ }
315
+ },
316
+ error: function() {
317
+ if(!settings.silent) {
318
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
319
+ module.error.apply(console, arguments);
320
+ }
321
+ },
322
+ performance: {
323
+ log: function(message) {
324
+ var
325
+ currentTime,
326
+ executionTime,
327
+ previousTime
328
+ ;
329
+ if(settings.performance) {
330
+ currentTime = new Date().getTime();
331
+ previousTime = time || currentTime;
332
+ executionTime = currentTime - previousTime;
333
+ time = currentTime;
334
+ performance.push({
335
+ 'Name' : message[0],
336
+ 'Arguments' : [].slice.call(message, 1) || '',
337
+ 'Element' : element,
338
+ 'Execution Time' : executionTime
339
+ });
340
+ }
341
+ clearTimeout(module.performance.timer);
342
+ module.performance.timer = setTimeout(module.performance.display, 500);
343
+ },
344
+ display: function() {
345
+ var
346
+ title = settings.name + ':',
347
+ totalTime = 0
348
+ ;
349
+ time = false;
350
+ clearTimeout(module.performance.timer);
351
+ $.each(performance, function(index, data) {
352
+ totalTime += data['Execution Time'];
353
+ });
354
+ title += ' ' + totalTime + 'ms';
355
+ if(moduleSelector) {
356
+ title += ' \'' + moduleSelector + '\'';
357
+ }
358
+ if($allModules.length > 1) {
359
+ title += ' ' + '(' + $allModules.length + ')';
360
+ }
361
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
362
+ console.groupCollapsed(title);
363
+ if(console.table) {
364
+ console.table(performance);
365
+ }
366
+ else {
367
+ $.each(performance, function(index, data) {
368
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
369
+ });
370
+ }
371
+ console.groupEnd();
372
+ }
373
+ performance = [];
374
+ }
375
+ },
376
+ invoke: function(query, passedArguments, context) {
377
+ var
378
+ object = instance,
379
+ maxDepth,
380
+ found,
381
+ response
382
+ ;
383
+ passedArguments = passedArguments || queryArguments;
384
+ context = element || context;
385
+ if(typeof query == 'string' && object !== undefined) {
386
+ query = query.split(/[\. ]/);
387
+ maxDepth = query.length - 1;
388
+ $.each(query, function(depth, value) {
389
+ var camelCaseValue = (depth != maxDepth)
390
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
391
+ : query
392
+ ;
393
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
394
+ object = object[camelCaseValue];
395
+ }
396
+ else if( object[camelCaseValue] !== undefined ) {
397
+ found = object[camelCaseValue];
398
+ return false;
399
+ }
400
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
401
+ object = object[value];
402
+ }
403
+ else if( object[value] !== undefined ) {
404
+ found = object[value];
405
+ return false;
406
+ }
407
+ else {
408
+ return false;
409
+ }
410
+ });
411
+ }
412
+ if ( $.isFunction( found ) ) {
413
+ response = found.apply(context, passedArguments);
414
+ }
415
+ else if(found !== undefined) {
416
+ response = found;
417
+ }
418
+ if($.isArray(returnedValue)) {
419
+ returnedValue.push(response);
420
+ }
421
+ else if(returnedValue !== undefined) {
422
+ returnedValue = [returnedValue, response];
423
+ }
424
+ else if(response !== undefined) {
425
+ returnedValue = response;
426
+ }
427
+ return found;
428
+ }
429
+ };
430
+ if(methodInvoked) {
431
+ if(instance === undefined) {
432
+ module.initialize();
433
+ }
434
+ module.invoke(query);
435
+ }
436
+ else {
437
+ if(instance !== undefined) {
438
+ instance.invoke('destroy');
439
+ }
440
+ module.initialize();
441
+ }
442
+ })
443
+ ;
444
+
445
+ return (returnedValue !== undefined)
446
+ ? returnedValue
447
+ : this
448
+ ;
449
+ };
450
+
451
+ $.fn.rating.settings = {
452
+
453
+ name : 'Rating',
454
+ namespace : 'rating',
455
+
456
+ slent : false,
457
+ debug : false,
458
+ verbose : false,
459
+ performance : true,
460
+
461
+ initialRating : 0,
462
+ interactive : true,
463
+ maxRating : 4,
464
+ clearable : 'auto',
465
+
466
+ fireOnInit : false,
467
+
468
+ onRate : function(rating){},
469
+
470
+ error : {
471
+ method : 'The method you called is not defined',
472
+ noMaximum : 'No maximum rating specified. Cannot generate HTML automatically'
473
+ },
474
+
475
+
476
+ metadata: {
477
+ rating : 'rating',
478
+ maxRating : 'maxRating'
479
+ },
480
+
481
+ className : {
482
+ active : 'active',
483
+ disabled : 'disabled',
484
+ selected : 'selected',
485
+ loading : 'loading'
486
+ },
487
+
488
+ selector : {
489
+ icon : '.icon'
490
+ },
491
+
492
+ templates: {
493
+ icon: function(maxRating) {
494
+ var
495
+ icon = 1,
496
+ html = ''
497
+ ;
498
+ while(icon <= maxRating) {
499
+ html += '<i class="icon"></i>';
500
+ icon++;
501
+ }
502
+ return html;
503
+ }
504
+ }
505
+
506
+ };
507
+
508
+ })( jQuery, window, document );