uikit 3.11.2-dev.4c11be04b → 3.11.2-dev.536e1a374
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/.eslintrc.json +4 -49
- package/.prettierignore +14 -0
- package/.prettierrc.json +13 -0
- package/.webstorm.js +3 -3
- package/CHANGELOG.md +59 -17
- package/build/.eslintrc.json +1 -3
- package/build/build.js +26 -28
- package/build/icons.js +7 -11
- package/build/less.js +48 -36
- package/build/package.json +2 -2
- package/build/prefix.js +21 -18
- package/build/publishDev.js +6 -8
- package/build/release.js +20 -17
- package/build/scope.js +21 -11
- package/build/scss.js +72 -39
- package/build/util.js +71 -62
- package/build/wrapper/icons.js +0 -2
- package/dist/css/uikit-core-rtl.css +133 -201
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +133 -201
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +135 -207
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +135 -207
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +66 -138
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +408 -439
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1091 -1319
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1137 -1396
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +94 -114
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +347 -372
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +345 -360
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +749 -843
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +345 -360
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +628 -798
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +587 -621
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +324 -356
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +156 -167
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +5325 -6495
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +7 -9
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +8007 -9632
- package/dist/js/uikit.min.js +1 -1
- package/jsconfig.json +1 -1
- package/package.json +64 -60
- package/src/js/api/boot.js +25 -32
- package/src/js/api/component.js +15 -28
- package/src/js/api/global.js +6 -12
- package/src/js/api/hooks.js +14 -33
- package/src/js/api/instance.js +7 -15
- package/src/js/api/state.js +199 -187
- package/src/js/components/countdown.js +32 -85
- package/src/js/components/filter.js +70 -66
- package/src/js/components/index.js +13 -13
- package/src/js/components/internal/lightbox-animations.js +14 -25
- package/src/js/components/internal/slider-preload.js +9 -0
- package/src/js/components/internal/slider-transitioner.js +66 -45
- package/src/js/components/internal/slideshow-animations.js +46 -64
- package/src/js/components/lightbox-panel.js +107 -105
- package/src/js/components/lightbox.js +17 -39
- package/src/js/components/notification.js +49 -43
- package/src/js/components/parallax.js +21 -46
- package/src/js/components/slider-parallax.js +13 -23
- package/src/js/components/slider.js +117 -89
- package/src/js/components/slideshow-parallax.js +1 -1
- package/src/js/components/slideshow.js +15 -13
- package/src/js/components/sortable.js +126 -108
- package/src/js/components/tooltip.js +41 -31
- package/src/js/components/upload.js +53 -63
- package/src/js/core/accordion.js +58 -48
- package/src/js/core/alert.js +9 -17
- package/src/js/core/core.js +17 -69
- package/src/js/core/cover.js +15 -15
- package/src/js/core/drop.js +110 -94
- package/src/js/core/form-custom.js +22 -27
- package/src/js/core/gif.js +3 -7
- package/src/js/core/grid.js +57 -58
- package/src/js/core/height-match.js +16 -29
- package/src/js/core/height-viewport.js +31 -35
- package/src/js/core/icon.js +47 -52
- package/src/js/core/img.js +153 -143
- package/src/js/core/index.js +39 -39
- package/src/js/core/leader.js +9 -18
- package/src/js/core/margin.js +21 -37
- package/src/js/core/modal.js +49 -36
- package/src/js/core/nav.js +2 -4
- package/src/js/core/navbar.js +113 -85
- package/src/js/core/offcanvas.js +51 -54
- package/src/js/core/overflow-auto.js +13 -17
- package/src/js/core/responsive.js +14 -12
- package/src/js/core/scroll.js +10 -20
- package/src/js/core/scrollspy-nav.js +34 -31
- package/src/js/core/scrollspy.js +37 -54
- package/src/js/core/sticky.js +197 -132
- package/src/js/core/svg.js +68 -83
- package/src/js/core/switcher.js +56 -47
- package/src/js/core/tab.js +7 -10
- package/src/js/core/toggle.js +69 -68
- package/src/js/core/video.js +22 -21
- package/src/js/mixin/animate.js +19 -20
- package/src/js/mixin/class.js +2 -4
- package/src/js/mixin/container.js +7 -11
- package/src/js/mixin/internal/animate-fade.js +73 -30
- package/src/js/mixin/internal/animate-slide.js +58 -41
- package/src/js/mixin/internal/slideshow-animations.js +7 -14
- package/src/js/mixin/internal/slideshow-transitioner.js +10 -17
- package/src/js/mixin/lazyload.js +20 -0
- package/src/js/mixin/media.js +5 -10
- package/src/js/mixin/modal.js +89 -66
- package/src/js/mixin/parallax.js +149 -107
- package/src/js/mixin/position.js +26 -20
- package/src/js/mixin/slider-autoplay.js +12 -21
- package/src/js/mixin/slider-drag.js +64 -65
- package/src/js/mixin/slider-nav.js +26 -35
- package/src/js/mixin/slider-reactive.js +2 -8
- package/src/js/mixin/slider.js +47 -60
- package/src/js/mixin/slideshow.js +12 -22
- package/src/js/mixin/swipe.js +72 -0
- package/src/js/mixin/togglable.js +89 -63
- package/src/js/uikit-core.js +2 -4
- package/src/js/uikit.js +2 -4
- package/src/js/util/ajax.js +25 -40
- package/src/js/util/animation.js +77 -75
- package/src/js/util/attr.js +17 -21
- package/src/js/util/class.js +14 -52
- package/src/js/util/dimensions.js +78 -49
- package/src/js/util/dom.js +37 -66
- package/src/js/util/env.js +7 -12
- package/src/js/util/event.js +60 -59
- package/src/js/util/fastdom.js +3 -8
- package/src/js/util/filter.js +18 -36
- package/src/js/util/index.js +1 -1
- package/src/js/util/lang.js +82 -121
- package/src/js/util/mouse.js +19 -17
- package/src/js/util/observer.js +36 -0
- package/src/js/util/options.js +35 -49
- package/src/js/util/player.js +41 -36
- package/src/js/util/position.js +54 -46
- package/src/js/util/selector.js +43 -58
- package/src/js/util/style.js +39 -49
- package/src/js/util/viewport.js +81 -66
- package/src/less/components/base.less +10 -33
- package/src/less/components/flex.less +0 -9
- package/src/less/components/form-range.less +48 -95
- package/src/less/components/form.less +0 -1
- package/src/less/components/height.less +3 -0
- package/src/less/components/leader.less +0 -1
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/modal.less +3 -7
- package/src/less/components/navbar.less +0 -7
- package/src/less/components/progress.less +14 -36
- package/src/less/components/slider.less +0 -3
- package/src/less/components/slideshow.less +0 -3
- package/src/less/components/text.less +16 -32
- package/src/less/components/utility.less +25 -0
- package/src/scss/components/base.scss +10 -33
- package/src/scss/components/flex.scss +0 -9
- package/src/scss/components/form-range.scss +48 -95
- package/src/scss/components/form.scss +3 -4
- package/src/scss/components/height.scss +3 -0
- package/src/scss/components/icon.scss +2 -2
- package/src/scss/components/leader.scss +0 -1
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/modal.scss +3 -7
- package/src/scss/components/navbar.scss +0 -7
- package/src/scss/components/progress.scss +14 -36
- package/src/scss/components/search.scss +1 -1
- package/src/scss/components/slider.scss +0 -3
- package/src/scss/components/slideshow.scss +0 -3
- package/src/scss/components/text.scss +16 -32
- package/src/scss/components/utility.scss +25 -0
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/mixins.scss +1 -1
- package/src/scss/variables-theme.scss +9 -9
- package/src/scss/variables.scss +9 -9
- package/tests/align.html +10 -10
- package/tests/animation.html +2 -2
- package/tests/article.html +2 -2
- package/tests/base.html +3 -3
- package/tests/card.html +10 -10
- package/tests/column.html +3 -3
- package/tests/comment.html +9 -9
- package/tests/countdown.html +10 -8
- package/tests/dotnav.html +3 -3
- package/tests/image.html +296 -64
- package/tests/images/image-type.avif +0 -0
- package/tests/images/image-type.jpeg +0 -0
- package/tests/images/image-type.webp +0 -0
- package/tests/index.html +8 -8
- package/tests/js/index.js +114 -85
- package/tests/lightbox.html +10 -10
- package/tests/marker.html +2 -2
- package/tests/modal.html +8 -9
- package/tests/navbar.html +2 -2
- package/tests/overlay.html +7 -7
- package/tests/parallax.html +16 -7
- package/tests/position.html +12 -12
- package/tests/slidenav.html +12 -12
- package/tests/slider.html +20 -20
- package/tests/sortable.html +1 -1
- package/tests/sticky-parallax.html +87 -99
- package/tests/sticky.html +56 -24
- package/tests/svg.html +6 -6
- package/tests/table.html +11 -11
- package/tests/thumbnav.html +12 -12
- package/tests/transition.html +30 -30
- package/tests/utility.html +50 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/src/js/mixin/flex-bug.js +0 -56
- package/src/js/util/promise.js +0 -191
- package/tests/images/animated.gif +0 -0
package/.eslintrc.json
CHANGED
|
@@ -1,62 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"root":true,
|
|
2
|
+
"root": true,
|
|
3
3
|
"env": {
|
|
4
4
|
"es6": true,
|
|
5
5
|
"browser": true
|
|
6
6
|
},
|
|
7
|
-
"extends": [
|
|
8
|
-
"eslint:recommended"
|
|
9
|
-
],
|
|
7
|
+
"extends": ["eslint:recommended", "prettier"],
|
|
10
8
|
"parserOptions": {
|
|
11
|
-
"sourceType": "module"
|
|
9
|
+
"sourceType": "module",
|
|
10
|
+
"ecmaVersion": 2022
|
|
12
11
|
},
|
|
13
12
|
"globals": {
|
|
14
13
|
"VERSION": true,
|
|
15
14
|
"ICONS": true,
|
|
16
15
|
"NAME": true
|
|
17
|
-
},
|
|
18
|
-
"rules": {
|
|
19
|
-
"arrow-parens": ["error", "as-needed"],
|
|
20
|
-
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
|
|
21
|
-
"comma-dangle": ["error", "never"],
|
|
22
|
-
"comma-spacing": "error",
|
|
23
|
-
"comma-style": "error",
|
|
24
|
-
"eqeqeq": ["error", "smart"],
|
|
25
|
-
"eol-last": "error",
|
|
26
|
-
"indent": "off",
|
|
27
|
-
"indent-legacy": ["error", 4, {"SwitchCase": 1}],
|
|
28
|
-
"key-spacing": "error",
|
|
29
|
-
"keyword-spacing": "error",
|
|
30
|
-
"linebreak-style": ["error", "unix"],
|
|
31
|
-
"no-array-constructor": "error",
|
|
32
|
-
"no-case-declarations": "warn",
|
|
33
|
-
"no-duplicate-imports": "error",
|
|
34
|
-
"no-empty": ["error", {"allowEmptyCatch": true}],
|
|
35
|
-
"no-extend-native": "error",
|
|
36
|
-
"no-lone-blocks": "error",
|
|
37
|
-
"no-lonely-if": "error",
|
|
38
|
-
"no-multi-spaces": "error",
|
|
39
|
-
"no-multiple-empty-lines": ["error", {"max": 2, "maxEOF": 1, "maxBOF": 0}],
|
|
40
|
-
"no-template-curly-in-string": "error",
|
|
41
|
-
"no-trailing-spaces": "error",
|
|
42
|
-
"no-unused-vars": ["error", {"vars": "local", "args": "none"}],
|
|
43
|
-
"no-var": "error",
|
|
44
|
-
"object-curly-spacing": "error",
|
|
45
|
-
"object-shorthand": "error",
|
|
46
|
-
"prefer-const": ["error", {"destructuring": "all"}],
|
|
47
|
-
"prefer-destructuring": "warn",
|
|
48
|
-
"quotes": ["error", "single", {"avoidEscape": true}],
|
|
49
|
-
"semi": ["error", "always"],
|
|
50
|
-
"sort-imports": ["error", {
|
|
51
|
-
"ignoreCase": true,
|
|
52
|
-
"ignoreDeclarationSort": true
|
|
53
|
-
}],
|
|
54
|
-
"space-before-blocks": "error",
|
|
55
|
-
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}],
|
|
56
|
-
"space-in-parens": "error",
|
|
57
|
-
"space-infix-ops": "error",
|
|
58
|
-
"space-unary-ops": "error",
|
|
59
|
-
"spaced-comment": "error",
|
|
60
|
-
"template-curly-spacing": "error"
|
|
61
16
|
}
|
|
62
17
|
}
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
package/.webstorm.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
## WIP
|
|
4
4
|
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add support for `<picture>` element to Image component
|
|
8
|
+
- Add `sources` option to emulate `<picture>` element for background images to Image component
|
|
9
|
+
- Add `loading` option to avoid lazy loading background images in first visible viewport to Image component
|
|
10
|
+
- Add support for `loading="lazy"` attribute to SVG component
|
|
11
|
+
- Add `position` option with `top`, `bottom` and `auto` values to Sticky component
|
|
12
|
+
- Add support for basic math operands in `offset` option of Sticky component
|
|
13
|
+
- Add animation stop positions to Parallax component
|
|
14
|
+
- Add object fit and position classes to Utility component
|
|
15
|
+
- Add height viewport classes to Height component
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Image elements need `width` and `height` attributes to prevent layout shifts
|
|
20
|
+
- Image component no longer relies on session storage to check for cached images to immediately show an image
|
|
21
|
+
- Slider and Switcher remove native `loading="lazy"` attribute from adjacent slides
|
|
22
|
+
- Accordion, Drop, Switcher and Toggle remove native `loading="lazy"` attribute from their children when entering the viewport
|
|
23
|
+
- Improve sticky behavior if sticky content is larger than the viewport
|
|
24
|
+
- Sticky component's `bottom` option checks for bottom padding if sticky element is within referenced element
|
|
25
|
+
- Height Viewport component sets `uk-height-viewport` class to reduce initial layout shifts
|
|
26
|
+
|
|
27
|
+
### Deprecated
|
|
28
|
+
|
|
29
|
+
- Deprecate `uk-img` for `<img>` element: Use native `loading="lazy"` attribute instead
|
|
30
|
+
|
|
31
|
+
## Removed
|
|
32
|
+
|
|
33
|
+
- Remove IE11 support
|
|
34
|
+
- Removed `data-width` and `data-height` for `<img>` element from Image component. Use native attributes instead.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
5
38
|
- Fix infinite sliding in Slider component with equally sized slides
|
|
39
|
+
- Fix Slider component sets calculation
|
|
40
|
+
- Fix dropdowns not closing in Navbar component when hovering dropbar and navigation with keyboard
|
|
41
|
+
- Fix dropdown no longer closes if pointer is still moving towards it
|
|
42
|
+
- Fix `fadein` not transformed correctly to `fade-in` in scss build
|
|
43
|
+
- Fix Sticky component setting wrong margin for placeholder
|
|
44
|
+
- Fix Sticky placeholder sets height with fraction
|
|
45
|
+
- Fix Sticky component does not animate in if scroll position equals top offset
|
|
46
|
+
- Fix Sticky component prevents transition on `selTarget` if forced to hide for recalculation
|
|
47
|
+
- Fix Parallax component initial jump in background image
|
|
6
48
|
|
|
7
49
|
## 3.11.1 (February 7, 2022)
|
|
8
50
|
|
|
@@ -41,7 +83,7 @@
|
|
|
41
83
|
- Fix usage of `data-` prefix for Cover and Responsive component
|
|
42
84
|
- Fix pointer events for iframes in Cover component
|
|
43
85
|
- Fix Slideshow component no longer throws if items list does not exist
|
|
44
|
-
- Fix space key no longer triggers Toggle on
|
|
86
|
+
- Fix space key no longer triggers Toggle on `<input>` element
|
|
45
87
|
|
|
46
88
|
## 3.10.0 (January 12, 2022)
|
|
47
89
|
|
|
@@ -358,7 +400,7 @@
|
|
|
358
400
|
|
|
359
401
|
- Fix component update handling
|
|
360
402
|
- Fix Tooltip position
|
|
361
|
-
- Fix Tooltip component applied to button
|
|
403
|
+
- Fix Tooltip component applied to `<button>` element in iOS
|
|
362
404
|
- Fix regression in Switcher component
|
|
363
405
|
|
|
364
406
|
## 3.6.8 (January 5, 2021)
|
|
@@ -907,7 +949,7 @@
|
|
|
907
949
|
### Fixed
|
|
908
950
|
|
|
909
951
|
- Fix Slideshow invisible after switching tabs in Switcher
|
|
910
|
-
- Fix lazy loading images in
|
|
952
|
+
- Fix lazy loading images in Image component in UC Browser
|
|
911
953
|
- Fix opening Offcanvas/Modal through buttons
|
|
912
954
|
|
|
913
955
|
## 3.1.8 (August 29, 2019)
|
|
@@ -1077,8 +1119,8 @@
|
|
|
1077
1119
|
### Fixed
|
|
1078
1120
|
|
|
1079
1121
|
- Fix touch event detection
|
|
1080
|
-
- Fix background images are shown too large on retina displays in
|
|
1081
|
-
- Fix correctly calculate offsetLeft in
|
|
1122
|
+
- Fix background images are shown too large on retina displays in Image component
|
|
1123
|
+
- Fix correctly calculate offsetLeft in Image component
|
|
1082
1124
|
- Fix autofocus elements not blurring within Toggable on hide
|
|
1083
1125
|
|
|
1084
1126
|
## 3.0.2 (January 15, 2019)
|
|
@@ -1087,7 +1129,7 @@
|
|
|
1087
1129
|
|
|
1088
1130
|
- Fix offcanvas overlay transition
|
|
1089
1131
|
- Fix active state in Switcher component
|
|
1090
|
-
- Fix background images on displays with higher devicePixelRatio in
|
|
1132
|
+
- Fix background images on displays with higher devicePixelRatio in Image component
|
|
1091
1133
|
|
|
1092
1134
|
## 3.0.1 (January 14, 2019)
|
|
1093
1135
|
|
|
@@ -1120,7 +1162,7 @@
|
|
|
1120
1162
|
### Fixed
|
|
1121
1163
|
|
|
1122
1164
|
- Fix visible toggle and its child elements not being focusable through keyboard navigation
|
|
1123
|
-
- Fix
|
|
1165
|
+
- Fix Image component correctly escapes urls on background images
|
|
1124
1166
|
|
|
1125
1167
|
## 3.0.0 rc 26 (January 3, 2019)
|
|
1126
1168
|
|
|
@@ -1139,8 +1181,8 @@
|
|
|
1139
1181
|
- Fix `flex bug` mixin (IE 11)
|
|
1140
1182
|
- Fix properly resolving css custom properties in scss
|
|
1141
1183
|
- Fix order of variable assignments in scss
|
|
1142
|
-
- Fix background images are shown too large on retina displays in
|
|
1143
|
-
- Fix lazy loading images in
|
|
1184
|
+
- Fix background images are shown too large on retina displays in Image component
|
|
1185
|
+
- Fix lazy loading images in Image component in Safari
|
|
1144
1186
|
- Limit positioned element to container width and margin in Position component
|
|
1145
1187
|
|
|
1146
1188
|
## 3.0.0 rc 25 (November 30, 2018)
|
|
@@ -1228,7 +1270,7 @@
|
|
|
1228
1270
|
|
|
1229
1271
|
### Fixed
|
|
1230
1272
|
|
|
1231
|
-
- Fix preserve color not working if class is set on svg element in Icon component
|
|
1273
|
+
- Fix preserve color not working if class is set on `<svg>` element in Icon component
|
|
1232
1274
|
- Fix inverse hover color for accordion title
|
|
1233
1275
|
- Fix close color being overwritten from toolbar in Lightbox component
|
|
1234
1276
|
- Fix Modal not hiding upon being destroyed
|
|
@@ -1472,7 +1514,7 @@
|
|
|
1472
1514
|
|
|
1473
1515
|
### Added
|
|
1474
1516
|
|
|
1475
|
-
- Add
|
|
1517
|
+
- Add Image component to lazy load images
|
|
1476
1518
|
- Add Filter component to filter and sort any kind of layout
|
|
1477
1519
|
- Add `masonry` option to Grid component
|
|
1478
1520
|
- Add inverse style for form icon
|
|
@@ -1635,7 +1677,7 @@
|
|
|
1635
1677
|
|
|
1636
1678
|
### Changed
|
|
1637
1679
|
|
|
1638
|
-
- IMPORTANT: Use
|
|
1680
|
+
- IMPORTANT: Use `<a>` element instead of headings for the accordion title
|
|
1639
1681
|
- Calling a component constructor with data on an already initialized component will reset the component
|
|
1640
1682
|
- Dropbar no longer repositions Dropdowns in DOM upon opening
|
|
1641
1683
|
|
|
@@ -1736,7 +1778,7 @@
|
|
|
1736
1778
|
- Fix slide animations stacking when tab is not focused in Slideshow component
|
|
1737
1779
|
- Fix overlay not showing in Offcanvas component
|
|
1738
1780
|
- Fix Slideshow Parallax in Slideshow component for IE11
|
|
1739
|
-
- Fix default border-radius for button
|
|
1781
|
+
- Fix default border-radius for `<button>` element in Chrome 62.
|
|
1740
1782
|
|
|
1741
1783
|
## 3.0.0 beta 31 (October 20, 2017)
|
|
1742
1784
|
|
|
@@ -1845,7 +1887,7 @@
|
|
|
1845
1887
|
|
|
1846
1888
|
- Offcanvas will keep scroll position if anchor link was clicked
|
|
1847
1889
|
- Fix margin modifier in Position component for IE11
|
|
1848
|
-
- Fix divider-small text alignment for
|
|
1890
|
+
- Fix divider-small text alignment for `<hr>` element Edge and IE
|
|
1849
1891
|
- Fix setting the ratio of Spinner component
|
|
1850
1892
|
- Fix event handling in Sortable component
|
|
1851
1893
|
- Fix grid calculation (Firefox)
|
|
@@ -1881,7 +1923,7 @@
|
|
|
1881
1923
|
|
|
1882
1924
|
### Changed
|
|
1883
1925
|
|
|
1884
|
-
- Make Icon component work with button
|
|
1926
|
+
- Make Icon component work with `<button>` element
|
|
1885
1927
|
|
|
1886
1928
|
### Fixed
|
|
1887
1929
|
|
|
@@ -2211,7 +2253,7 @@
|
|
|
2211
2253
|
|
|
2212
2254
|
### Changed
|
|
2213
2255
|
|
|
2214
|
-
- UIkit observes
|
|
2256
|
+
- UIkit observes `<body>` element too now
|
|
2215
2257
|
- Performance improvements
|
|
2216
2258
|
|
|
2217
2259
|
### Fixed
|
|
@@ -2257,7 +2299,7 @@
|
|
|
2257
2299
|
|
|
2258
2300
|
### Fixed
|
|
2259
2301
|
|
|
2260
|
-
- Fix Icon component on canvas elements (Safari)
|
|
2302
|
+
- Fix Icon component on `<canvas>` elements (Safari)
|
|
2261
2303
|
|
|
2262
2304
|
## 3.0.0 beta 1 (January 09, 2017)
|
|
2263
2305
|
|
package/build/.eslintrc.json
CHANGED
package/build/build.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import camelize from 'camelcase';
|
|
2
|
-
import {basename, resolve} from 'path';
|
|
3
|
-
import {args, compile, glob, icons} from './util.js';
|
|
2
|
+
import { basename, resolve } from 'path';
|
|
3
|
+
import { args, compile, glob, icons } from './util.js';
|
|
4
4
|
|
|
5
5
|
const bundles = getBundleTasks();
|
|
6
6
|
const components = await getComponentTasks();
|
|
7
|
-
const buildAll =
|
|
8
|
-
|
|
9
|
-
).
|
|
7
|
+
const buildAll =
|
|
8
|
+
args.all ||
|
|
9
|
+
!Object.keys(args).filter((name) => !['d', 'debug', 'nominify', 'watch', '_'].includes(name))
|
|
10
|
+
.length;
|
|
10
11
|
|
|
11
12
|
if (args.h || args.help) {
|
|
12
13
|
console.log(`
|
|
@@ -30,62 +31,59 @@ if (args.h || args.help) {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
let tasks;
|
|
33
|
-
const allTasks = {...bundles, ...components};
|
|
34
|
+
const allTasks = { ...bundles, ...components };
|
|
34
35
|
if (buildAll) {
|
|
35
36
|
tasks = allTasks;
|
|
36
37
|
} else if (args.components) {
|
|
37
38
|
tasks = components;
|
|
38
39
|
} else {
|
|
39
40
|
tasks = Object.keys(args)
|
|
40
|
-
.map(step => allTasks[step])
|
|
41
|
-
.filter(t => t);
|
|
41
|
+
.map((step) => allTasks[step])
|
|
42
|
+
.filter((t) => t);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
await Promise.all(Object.values(tasks).map(task => task()));
|
|
45
|
+
await Promise.all(Object.values(tasks).map((task) => task()));
|
|
45
46
|
|
|
46
47
|
function getBundleTasks() {
|
|
47
48
|
return {
|
|
48
|
-
|
|
49
49
|
core: () => compile('src/js/uikit-core.js', 'dist/js/uikit-core'),
|
|
50
50
|
|
|
51
51
|
uikit: () => compile('src/js/uikit.js', 'dist/js/uikit'),
|
|
52
52
|
|
|
53
|
-
icons: async () =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
icons: async () =>
|
|
54
|
+
compile('build/wrapper/icons.js', 'dist/js/uikit-icons', {
|
|
55
|
+
name: 'icons',
|
|
56
|
+
replaces: { ICONS: await icons('{src/images,custom}/icons/*.svg') },
|
|
57
|
+
}),
|
|
58
|
+
|
|
59
|
+
tests: async () =>
|
|
60
|
+
compile('tests/js/index.js', 'tests/js/test', {
|
|
61
|
+
name: 'test',
|
|
62
|
+
replaces: { TESTS: await getTestFiles() },
|
|
63
|
+
}),
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
async function getComponentTasks() {
|
|
67
|
-
|
|
68
68
|
const components = await glob('src/js/components/!(index).js');
|
|
69
69
|
|
|
70
70
|
return components.reduce((components, file) => {
|
|
71
|
-
|
|
72
71
|
const name = basename(file, '.js');
|
|
73
72
|
|
|
74
73
|
components[name] = () =>
|
|
75
74
|
compile('build/wrapper/component.js', `dist/js/components/${name}`, {
|
|
76
75
|
name,
|
|
77
76
|
external: ['uikit', 'uikit-util'],
|
|
78
|
-
globals: {uikit: 'UIkit', 'uikit-util': 'UIkit.util'},
|
|
79
|
-
aliases: {component: resolve('src/js/components', name)},
|
|
80
|
-
replaces: {NAME: `'${camelize(name)}'`}
|
|
77
|
+
globals: { uikit: 'UIkit', 'uikit-util': 'UIkit.util' },
|
|
78
|
+
aliases: { component: resolve('src/js/components', name) },
|
|
79
|
+
replaces: { NAME: `'${camelize(name)}'` },
|
|
81
80
|
});
|
|
82
81
|
|
|
83
82
|
return components;
|
|
84
|
-
|
|
85
83
|
}, {});
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
async function getTestFiles() {
|
|
89
|
-
const files = await glob('tests/!(index).html', {nosort: true});
|
|
90
|
-
return JSON.stringify(files.map(file => basename(file, '.html')));
|
|
87
|
+
const files = await glob('tests/!(index).html', { nosort: true });
|
|
88
|
+
return JSON.stringify(files.map((file) => basename(file, '.html')));
|
|
91
89
|
}
|
package/build/icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {args, compile, glob, icons} from './util.js';
|
|
1
|
+
import { args, compile, glob, icons } from './util.js';
|
|
2
2
|
|
|
3
3
|
if (args.h || args.help) {
|
|
4
4
|
console.log(`
|
|
@@ -25,14 +25,10 @@ await Promise.all((await glob(path)).map(compileIcons));
|
|
|
25
25
|
|
|
26
26
|
async function compileIcons(folder) {
|
|
27
27
|
const [, name] = folder.toString().match(new RegExp(match, 'i'));
|
|
28
|
-
return compile(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
ICONS: await icons(`{src/images/icons,${folder}}/*.svg`)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
);
|
|
28
|
+
return compile('build/wrapper/icons.js', `dist/js/uikit-icons-${name}`, {
|
|
29
|
+
name,
|
|
30
|
+
replaces: {
|
|
31
|
+
ICONS: await icons(`{src/images/icons,${folder}}/*.svg`),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
38
34
|
}
|
package/build/less.js
CHANGED
|
@@ -1,59 +1,72 @@
|
|
|
1
1
|
import rtlcss from 'rtlcss';
|
|
2
|
-
import {basename} from 'path';
|
|
3
|
-
import {
|
|
2
|
+
import { basename } from 'path';
|
|
3
|
+
import {
|
|
4
|
+
args,
|
|
5
|
+
banner,
|
|
6
|
+
glob,
|
|
7
|
+
minify,
|
|
8
|
+
pathExists,
|
|
9
|
+
read,
|
|
10
|
+
readJson,
|
|
11
|
+
renderLess,
|
|
12
|
+
write,
|
|
13
|
+
} from './util.js';
|
|
4
14
|
|
|
5
|
-
const {rtl} = args;
|
|
15
|
+
const { rtl } = args;
|
|
6
16
|
const develop = args.develop || args.debug || args.d || args.nominify;
|
|
7
17
|
const sources = [
|
|
8
|
-
{src: 'src/less/uikit.less', dist: `dist/css/uikit-core${rtl ? '-rtl' : ''}.css`},
|
|
9
|
-
{src: 'src/less/uikit.theme.less', dist: `dist/css/uikit${rtl ? '-rtl' : ''}.css`}
|
|
18
|
+
{ src: 'src/less/uikit.less', dist: `dist/css/uikit-core${rtl ? '-rtl' : ''}.css` },
|
|
19
|
+
{ src: 'src/less/uikit.theme.less', dist: `dist/css/uikit${rtl ? '-rtl' : ''}.css` },
|
|
10
20
|
];
|
|
11
21
|
|
|
12
|
-
const themes = await pathExists('themes.json') ? await readJson('themes.json') : {};
|
|
22
|
+
const themes = (await pathExists('themes.json')) ? await readJson('themes.json') : {};
|
|
13
23
|
|
|
14
24
|
for (const src of await glob('custom/*.less')) {
|
|
15
25
|
const theme = basename(src, '.less');
|
|
16
26
|
const dist = `dist/css/uikit.${theme}${rtl ? '-rtl' : ''}.css`;
|
|
17
27
|
|
|
18
|
-
themes[theme] = {css: `../${dist}`};
|
|
28
|
+
themes[theme] = { css: `../${dist}` };
|
|
19
29
|
|
|
20
30
|
if (await pathExists(`dist/js/uikit-icons-${theme}.js`)) {
|
|
21
31
|
themes[theme].icons = `../dist/js/uikit-icons-${theme}.js`;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
sources.push({src, dist});
|
|
34
|
+
sources.push({ src, dist });
|
|
25
35
|
}
|
|
26
36
|
|
|
27
|
-
await Promise.all(sources.map(({src, dist}) => compile(src, dist, develop, rtl)));
|
|
37
|
+
await Promise.all(sources.map(({ src, dist }) => compile(src, dist, develop, rtl)));
|
|
28
38
|
|
|
29
|
-
if (!rtl && (Object.keys(themes).length || !await pathExists('themes.json'))) {
|
|
39
|
+
if (!rtl && (Object.keys(themes).length || !(await pathExists('themes.json')))) {
|
|
30
40
|
await write('themes.json', JSON.stringify(themes));
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
async function compile(file, dist, develop, rtl) {
|
|
34
|
-
|
|
35
44
|
const less = await read(file);
|
|
36
45
|
|
|
37
|
-
let output = (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
let output = (
|
|
47
|
+
await renderLess(less, {
|
|
48
|
+
relativeUrls: true,
|
|
49
|
+
rootpath: '../../',
|
|
50
|
+
paths: ['src/less/', 'custom/'],
|
|
51
|
+
})
|
|
52
|
+
).replace(/\.\.\/dist\//g, '');
|
|
42
53
|
|
|
43
54
|
if (rtl) {
|
|
44
55
|
output = rtlcss.process(
|
|
45
56
|
output,
|
|
46
57
|
{
|
|
47
|
-
stringMap: [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
stringMap: [
|
|
59
|
+
{
|
|
60
|
+
name: 'previous-next',
|
|
61
|
+
priority: 100,
|
|
62
|
+
search: ['previous', 'Previous', 'PREVIOUS'],
|
|
63
|
+
replace: ['next', 'Next', 'NEXT'],
|
|
64
|
+
options: {
|
|
65
|
+
scope: '*',
|
|
66
|
+
ignoreCase: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
57
70
|
},
|
|
58
71
|
[
|
|
59
72
|
{
|
|
@@ -61,23 +74,23 @@ async function compile(file, dist, develop, rtl) {
|
|
|
61
74
|
priority: 50,
|
|
62
75
|
directives: {
|
|
63
76
|
control: {},
|
|
64
|
-
value: []
|
|
77
|
+
value: [],
|
|
65
78
|
},
|
|
66
79
|
processors: [
|
|
67
80
|
{
|
|
68
81
|
expr: ['--uk-position-translate-x', 'stroke-dashoffset'].join('|'),
|
|
69
82
|
action(prop, value, context) {
|
|
70
|
-
return {prop, value: context.util.negate(value)};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
}
|
|
83
|
+
return { prop, value: context.util.negate(value) };
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
75
88
|
],
|
|
76
89
|
{
|
|
77
90
|
pre(root, postcss) {
|
|
78
|
-
root.prepend(postcss.comment({text: 'rtl:begin:rename'}));
|
|
79
|
-
root.append(postcss.comment({text: 'rtl:end:rename'}));
|
|
80
|
-
}
|
|
91
|
+
root.prepend(postcss.comment({ text: 'rtl:begin:rename' }));
|
|
92
|
+
root.append(postcss.comment({ text: 'rtl:end:rename' }));
|
|
93
|
+
},
|
|
81
94
|
}
|
|
82
95
|
);
|
|
83
96
|
}
|
|
@@ -87,5 +100,4 @@ async function compile(file, dist, develop, rtl) {
|
|
|
87
100
|
if (!develop) {
|
|
88
101
|
await minify(dist);
|
|
89
102
|
}
|
|
90
|
-
|
|
91
103
|
}
|
package/build/package.json
CHANGED
package/build/prefix.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
|
-
import {args, glob, read, replaceInFile, validClassName} from './util.js';
|
|
2
|
+
import { args, glob, read, replaceInFile, validClassName } from './util.js';
|
|
3
3
|
|
|
4
4
|
if (args.h || args.help) {
|
|
5
5
|
console.log(`
|
|
@@ -26,24 +26,27 @@ if (currentPrefix === prefix) {
|
|
|
26
26
|
await replacePrefix(currentPrefix, prefix);
|
|
27
27
|
|
|
28
28
|
async function findExistingPrefix() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return (await read('dist/css/uikit.css')).match(
|
|
30
|
+
new RegExp(`(${validClassName.source})(-[a-z]+)?-grid`)
|
|
31
|
+
)?.[1];
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
async function getPrefix() {
|
|
35
|
-
|
|
36
35
|
const prefixFromInput = args.p || args.prefix;
|
|
37
36
|
|
|
38
37
|
if (!prefixFromInput) {
|
|
39
|
-
|
|
40
38
|
const prompt = inquirer.createPromptModule();
|
|
41
39
|
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
return (
|
|
41
|
+
await prompt({
|
|
42
|
+
name: 'prefix',
|
|
43
|
+
message: 'enter a prefix',
|
|
44
|
+
validate: (val, res) =>
|
|
45
|
+
val.length && val.match(validClassName)
|
|
46
|
+
? !!(res.prefix = val)
|
|
47
|
+
: 'invalid prefix',
|
|
48
|
+
})
|
|
49
|
+
).prefix;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
if (validClassName.test(prefixFromInput)) {
|
|
@@ -55,16 +58,16 @@ async function getPrefix() {
|
|
|
55
58
|
|
|
56
59
|
async function replacePrefix(from, to) {
|
|
57
60
|
for (const file of await glob('dist/**/*.css')) {
|
|
58
|
-
await replaceInFile(file, data =>
|
|
59
|
-
new RegExp(`${from}-${/([a-z\d-]+)/.source}`, 'g'),
|
|
60
|
-
|
|
61
|
-
));
|
|
61
|
+
await replaceInFile(file, (data) =>
|
|
62
|
+
data.replace(new RegExp(`${from}-${/([a-z\d-]+)/.source}`, 'g'), `${to}-$1`)
|
|
63
|
+
);
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
for (const file of await glob('dist/**/*.js')) {
|
|
65
|
-
await replaceInFile(file, data =>
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
await replaceInFile(file, (data) =>
|
|
68
|
+
data
|
|
69
|
+
.replace(new RegExp(`${from}-`, 'g'), `${to}-`)
|
|
70
|
+
.replace(new RegExp(`(${from})?UIkit`, 'g'), `${to === 'uk' ? '' : to}UIkit`)
|
|
68
71
|
);
|
|
69
72
|
}
|
|
70
73
|
}
|