-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customization: CSS, String template, Row template #15
Commits on Jul 1, 2021
-
import custom <style> tag to Shadow DOM
this small but powerful addition allows a user of the element to define a custom <style> element inside of the custom element, which is then moved in to the Shadow DOM. The <style> tag can define arbitrary CSS of course, but the main (and supported) way of using it is to override CSS variables to customize the styling of the element. Example: <ge-autocomplete …> <style> :host { --input-bg: salmon; --loading-color: red; } </style> </ge-autocomplete>
Configuration menu - View commit details
-
Copy full SHA for 4df54bf - Browse repository at this point
Copy the full SHA 4df54bfView commit details -
customization: support custom lodash template to render result row
this is the second (after CSS), very powerful customization feature: it allows a user of the element to define a <template row> tag inside the custom element, and inside of that they can create HTML markup as well as access the data of the row (the Feature) through the lodash template language. Example: <ge-autocomplete …> <template row> <div>${feature.properties.gid}: ${feature.properties.name}</div> </template> </ge-autocomplete>
Configuration menu - View commit details
-
Copy full SHA for d1d036a - Browse repository at this point
Copy the full SHA d1d036aView commit details -
customization: add string template
this template allows customization of the way a Feature is converted into a string and can be used for "smaller" customization where a fully new template with custom styles would be overkill. Also this applies to the resulting string that is placed in the input field after an item is selected. this commit also refactors the way templates are passed to parse them both in a single function instead of duplicating the logic. This also allows easily adding more templates in the future.
Configuration menu - View commit details
-
Copy full SHA for c6e4561 - Browse repository at this point
Copy the full SHA c6e4561View commit details -
Configuration menu - View commit details
-
Copy full SHA for c3e5419 - Browse repository at this point
Copy the full SHA c3e5419View commit details
Commits on Jul 2, 2021
-
docs: customization: fix code sample
Co-authored-by: Julian Simioni <orangejulius@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 90193d0 - Browse repository at this point
Copy the full SHA 90193d0View commit details -
customization: templates: namespace feature as
item.feature
by moving the actual feature data one level down we can add metadata to the top level of the object, such as `active`, `index`, and `searchTerm`, so the template can use ${item.feature.properties} ${item.active} that way the meta properties don’t conflict with the geo data itself
Configuration menu - View commit details
-
Copy full SHA for 46dfc02 - Browse repository at this point
Copy the full SHA 46dfc02View commit details
Commits on Jul 6, 2021
-
Configuration menu - View commit details
-
Copy full SHA for fcb8647 - Browse repository at this point
Copy the full SHA fcb8647View commit details