@patternslib/patternslib
Advanced tools
Changelog
9.7.0-alpha.4 (2022-10-24)
Changelog
9.7.0-alpha.3 (2022-10-17)
Changelog
9.7.0-alpha.2 (2022-10-15)
Build: Add distribution files to npm. (a6e10a3)By adding the build to the npm package you can include Patternslib via CDN like: https://cdn.jsdelivr.net/npm/@patternslib/patternslib@9.7.0-alpha.2/dist/bundle.min.js or https://unpkg.com/@patternslib/patternslib@9.7.0-alpha.2/dist/bundle.min.js
Tests: Add $(":visible") pseudo selector for jQuery. (7e8ccf4)
Build: Move webpack Module Federation config from here to @patternslib/dev but keep backwards compatible exports in here. (a0f7c07)
Build: Upgrade dependencies. (d6c34ac)
Docs: Document core.dom.is_visible. (e4f7bfe)
Tests: Remove unnecessary console.log from pat-validation tests. (fdaea14)
Tests: Remove unnecessary console.log statements from pat-clone-code tests. (19843ad)
Tests: Update is_visible mock to latest code changes - hidden is not set anymore due to form validation incompatibilities with Chrome. (41e56e0)
Tests: Use real path for @patternslib/patternslib module mapping. When extending this config elsewhere the path would not be right. (37520b7)
Changelog
9.7.0-alpha.1 (2022-10-11)
Build: Add global switch window.__patternslib_disable_modernizr to optionally disable modernizr. (2a0ec96)While this is convenient to quickly disable modernizr and also splits modernizr out from the main bundle entry file it was necessary for the clone-code pattern to get a clean code example for the whole html tree.
core registry: Move clone-code Pattern to the beginning. (9f7f5ef)We want clone-code to clone the markup before any other patterns are modifying it.
pat-date-picker: Add placeholder support for styled behavior. (752036f)/cc @cornae This fixes the following two issues:
Fixes: https://github.com/Patternslib/Patterns/issues/837 Fixes: https://github.com/quaive/ploneintranet.prototype/issues/1289
pat-markdown: Initialize syntax highlight when parsing markup. (8fd88c0)
pat-markdown: Switch to marked as markdown library to support better syntax highlight libraries. (3739935)
pat-sortable: Add the sortable-item class to each sortable element. (0513102)The current situation requires the integrator to add the sortable-item
class
on all sortables manually. If that is not done there can be styling problems
like a missing insert marker which makes it hard to use the pattern. As the
pattern already defines what should be a sortable it we also let the pattern
assign the class "sortable-item".
pat-sortable: Optionally import the sortable styles. (fe90c73)Import the sortable styles when the global variable
__patternslib_import_styles
is set to true
(the default is false
).
This allows to show the sortable marker without having to separately
load all the styles.
pat-sortable: Support dynamic sortable lists. (5f3076c)When new items were added to a sortable list e.g. via pat-clone or
pat-inject, those items could not be sorted. We are now re-initializing
the sortable pattern after a pat-update
event and make new elements
sortable.
pat-syntax-highlight: Switch to highlight.js. (85212ba)highlight.js allows to dyamically load languages in a webpack environment (almost, see next commit). Prism.js is mainly a Node.js library and currently not suited to load languages dynamically.
pat-validation: Validate also newly added form elements. (8838da0)When form elements were added via user interaction - e.g. by using
pat-clone or pat-inject - those elements were not validated. Now the
form validation is re-initialized after a pat-update
event and this
problem is fixed.
core registry: Do not scan TextNode content for patterns. (76a83c5)TextNode cannot hold markup, so there is also no needto scan those elements for patterns.
pat-date-picker: Do not throw a blur event after selecting a date. (a20a883)When a date was selected with the date picker a blur
and changed
event was thrown. Now we only throw a changed
event if da date was
selected. If no date was selected we throw a blur
event allow
pat-validation do validate required date input fields when no value was
given.
pat-syntax-highlight: Depend on highlight.js <11. (0f00d8c)highlight.js version 11 does not allow dynamic imports of languages and styles with webpack due to an exports field in package.json.
See: https://github.com/highlightjs/highlight.js/issues/3634
pat-validation: Fallback error messages for not-before and not-after. (831ee60)If no error messages were provided for the not-before and not-after constraints on date fields no error messages were shown even when those inputs had form validation errors. Now we are always providing a fallback error message based on the label or input name.
pat-validation: Fix problem with multiple form validation runs. (a8b7981)Due to some event listers calling each other multiple times, the form was validated up to 5 times in one validation run. This commit fixes multiple validation runs when a form element was disabled, e.g. when the submit button was disabled after validation errors.
core utils: Improve escape/unescape for safer version which makes use use of browser features. (97ca0b1)
core utils: safeClone - document which versions of IE are affected. (8bec57a)
pat-markdown: Modernize code. (81c4e14)
pat-syntax-highlight: Switch to class based pattern. (8fb23e1)
pat-toggle: Add alias attribute for attr to toggle an attribute. (fcfdb84)
pat-validation: Rename log to logger for better naming. (9ed77c8)
pat-validation: Use more debug messages. (c8c656a)
Changelog
9.7.0-alpha.0 (2022-09-28)
For usage see: src/core/basepattern.md
Changelog
9.6.1 (2022-09-28)
Changelog
9.6.0 (2022-09-28)
core events: Add blur and focus event factories. (c5942d2)
pat auto suggest: Improve pat-validation integration. (11e9a0b)Allow pat-validate to check for validity when select2 was interacted with but no value selected.
pat date picker: Improve pat-validation integration. (57c974b)Allow pat-validate to check for validity when date picker was interacted with but no value selected.
pat validation: Validate whole form on submit or single error. (bc27e41)Validate the whole form when a single error happens and some elements were disabled or when a form submit is done. This gives the user a better feedback about any data problems in the form and allows the user to see any other errors at all since the submit elements could have been disabled and form validation would eventually not be triggered.
Changelog
9.5.0 (2022-09-27)
core registry: Always put pat-validation first in the pattern execution chain. (27fb575)
pat validation: Fix problem with submitting invalid forms with pat-inject. (b01819a)Stop submit event propagation if the form is invalid. This fixes a problem where a invalid form could be submitted via pat-inject.
Changelog
9.4.0 (2022-09-23)
pat forward: Do not steal the click event. (7755aa8)When a pat-forward element is clicked, allow to propagate the click event so that other handlers can also react. Fixes: https://github.com/Patternslib/Patterns/issues/1063
pat tooltip: Keep the title attribute for source ajax and content. (fa6bff7)The tooltip element's title attribute is only stripped if the source is set to title (the default) and kept otherwise. Fixes: https://github.com/Patternslib/Patterns/issues/945
pat inject: Update the URL earlier (a02488d)Update the history/URL after the injection has been done and before post processing - e.g. scanning for new patterns - is happening. Other patterns like pat-navigation are depending on an updated URL state.
pat navigation: Fix selector for checking existing current classes. (3091a29)