-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from fleetbase/dev-v0.2.27
v0.2.27
- Loading branch information
Showing
17 changed files
with
376 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<Checkbox @id={{this.id}} @onToggle={{this.onToggle}} @value={{@value}} /> | ||
<Checkbox @id={{this.id}} @onToggle={{this.onToggle}} @value={{this.checked}} {{did-update this.trackValue @value}} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { later } from '@ember/runloop'; | ||
|
||
export default function loadAssets(assets = { basePath: '', scripts: [], stylesheets: [], globalIndicatorKey: null }) { | ||
// Set global indicator key if applicable | ||
if (assets.globalIndicatorKey && typeof assets.globalIndicatorKey === 'string') { | ||
window[assets.globalIndicatorKey] = false; | ||
} | ||
|
||
// Prepare base path | ||
const path = `/${assets.basePath ? assets.basePath + '/' : ''}`; | ||
|
||
// Define exports on window | ||
const exportsScript = document.createElement('script'); | ||
exportsScript.innerHTML = 'window.exports = window.exports || {};'; | ||
document.body.appendChild(exportsScript); | ||
|
||
// Insert scripts | ||
for (let i = 0; i < assets.scripts.length; i++) { | ||
const script = document.createElement('script'); | ||
script.src = path + assets.scripts[i]; | ||
document.body.appendChild(script); | ||
} | ||
|
||
// Insert stylesheets | ||
for (let i = 0; i < assets.stylesheets.length; i++) { | ||
const link = document.createElement('link'); | ||
link.rel = 'stylesheet'; | ||
link.href = path + assets.stylesheets[i]; | ||
document.body.appendChild(link); | ||
} | ||
|
||
// Update global indicator key | ||
later( | ||
this, | ||
() => { | ||
if (assets.globalIndicatorKey && typeof assets.globalIndicatorKey === 'string') { | ||
window[assets.globalIndicatorKey] = true; | ||
} | ||
}, | ||
300 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import loadAssets from './load-assets'; | ||
|
||
export default function loadLeafletPlugins(assets = { basePath: null, scripts: [], stylesheets: [], globalIndicatorKey: null }) { | ||
const basePath = assets.basePath ?? 'engines-dist/leaflet'; | ||
loadAssets({ basePath, ...assets }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from '@fleetbase/ember-ui/utils/load-assets'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from '@fleetbase/ember-ui/utils/load-leaflet-plugins'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@fleetbase/ember-ui", | ||
"version": "0.2.26", | ||
"version": "0.2.27", | ||
"description": "Fleetbase UI provides all the interface components, helpers, services and utilities for building a Fleetbase extension into the Console.", | ||
"keywords": [ | ||
"fleetbase-ui", | ||
|
@@ -91,6 +91,7 @@ | |
"ember-get-config": "^2.1.1", | ||
"ember-gridstack": "^4.0.0", | ||
"ember-inflector": "^4.0.2", | ||
"ember-leaflet": "^5.1.3", | ||
"ember-loading": "^2.0.0", | ||
"ember-math-helpers": "^4.0.0", | ||
"ember-modifier": "^4.1.0", | ||
|
@@ -106,6 +107,7 @@ | |
"gridstack": "^7.3.0", | ||
"imask": "^6.4.3", | ||
"intl-tel-input": "^22.0.2", | ||
"leaflet": "^1.9.4", | ||
"postcss-at-rules-variables": "^0.3.0", | ||
"postcss-conditionals-renewed": "^1.0.0", | ||
"postcss-each": "^1.1.0", | ||
|
@@ -152,6 +154,7 @@ | |
"prettier": "^3.0.3", | ||
"qunit": "^2.20.0", | ||
"qunit-dom": "^2.0.0", | ||
"resolve": "^1.22.8", | ||
"stylelint": "^15.11.0", | ||
"stylelint-config-standard": "^34.0.0", | ||
"stylelint-prettier": "^4.0.2", | ||
|
@@ -186,7 +189,8 @@ | |
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
"[email protected]": "patches/[email protected]", | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
diff --git a/index.js b/index.js | ||
index 7361871adfe0b79c70a3699e38cc435f3741cb33..fe08a429d35283691de28f3dc73ef7ec8bec76cb 100644 | ||
--- a/index.js | ||
+++ b/index.js | ||
@@ -1,36 +1,18 @@ | ||
-'use strict'; | ||
-const resolve = require('resolve'); | ||
-const path = require('path'); | ||
-const mergeTrees = require('broccoli-merge-trees'); | ||
-const Funnel = require('broccoli-funnel'); | ||
-const fastbootTransform = require('fastboot-transform'); | ||
+'use strict' | ||
+const resolve = require('resolve') | ||
+const path = require('path') | ||
+const mergeTrees = require('broccoli-merge-trees') | ||
+const Funnel = require('broccoli-funnel') | ||
+const fastbootTransform = require('fastboot-transform') | ||
|
||
module.exports = { | ||
name: require('./package').name, | ||
|
||
- treeForVendor() { | ||
- let dist = path.join(this.pathBase('leaflet'), 'dist'); | ||
- | ||
- let leafletJs = fastbootTransform( | ||
- new Funnel(dist, { | ||
- files: ['leaflet-src.js'], | ||
- destDir: 'leaflet' | ||
- }) | ||
- ); | ||
- | ||
- let leafletFiles = new Funnel(dist, { | ||
- exclude: ['leaflet.js', 'leaflet-src.js', '*.html'], | ||
- destDir: 'leaflet' | ||
- }); | ||
- | ||
- return mergeTrees([leafletJs, leafletFiles]); | ||
- }, | ||
- | ||
- included(app) { | ||
- this._super.included.apply(this, arguments); | ||
+ included (app) { | ||
+ this._super.included.apply(this, arguments) | ||
|
||
// Addon options from the apps ember-cli-build.js | ||
- let options = app.options[this.name] || {}; | ||
+ let options = app.options[this.name] || {} | ||
|
||
// If the addon has the _findHost() method (in ember-cli >= 2.7.0), we'll just | ||
// use that. | ||
@@ -42,46 +24,22 @@ module.exports = { | ||
// method in ember-cli. | ||
// Keep iterating upward until we don't have a grandparent. | ||
// Has to do this grandparent check because at some point we hit the project. | ||
- let current = this; | ||
+ let current = this | ||
do { | ||
- if (current.lazyLoading === true || (current.lazyLoading && current.lazyLoading.enabled === true)) { | ||
- app = current; | ||
- break; | ||
+ if ( | ||
+ current.lazyLoading === true || | ||
+ (current.lazyLoading && current.lazyLoading.enabled === true) | ||
+ ) { | ||
+ app = current | ||
+ break | ||
} | ||
- app = current.app || app; | ||
- } while (current.parent.parent && (current = current.parent)); | ||
- | ||
- if (!options.excludeJS) { | ||
- app.import('vendor/leaflet/leaflet-src.js'); | ||
- } | ||
- | ||
- // Import leaflet css | ||
- if (!options.excludeCSS) { | ||
- app.import('vendor/leaflet/leaflet.css'); | ||
- } | ||
- | ||
- // Import leaflet images | ||
- if (!options.excludeImages) { | ||
- let imagesDestDir = '/assets/images'; | ||
- app.import('vendor/leaflet/images/layers-2x.png', { | ||
- destDir: imagesDestDir | ||
- }); | ||
- app.import('vendor/leaflet/images/layers.png', { | ||
- destDir: imagesDestDir | ||
- }); | ||
- app.import('vendor/leaflet/images/marker-icon-2x.png', { | ||
- destDir: imagesDestDir | ||
- }); | ||
- app.import('vendor/leaflet/images/marker-icon.png', { | ||
- destDir: imagesDestDir | ||
- }); | ||
- app.import('vendor/leaflet/images/marker-shadow.png', { | ||
- destDir: imagesDestDir | ||
- }); | ||
- } | ||
+ app = current.app || app | ||
+ } while (current.parent.parent && (current = current.parent)) | ||
}, | ||
|
||
- pathBase(packageName) { | ||
- return path.dirname(resolve.sync(packageName + '/package.json', { basedir: __dirname })); | ||
+ pathBase (packageName) { | ||
+ return path.dirname( | ||
+ resolve.sync(packageName + '/package.json', { basedir: __dirname }) | ||
+ ) | ||
} | ||
-}; | ||
+} |
Oops, something went wrong.