Releases: Patternslib/Patterns
Release 9.7.0-alpha.5
9.7.0-alpha.5 (2022-10-26)
Bug Fixes
- pat markdown: Restore old behavior where the trigger element was replaced with the rendered content wrapped in a div. (ecb0330)
Release 9.7.0-alpha.4
9.7.0-alpha.4 (2022-10-24)
Features
- core dom: Add "delete_data" to remove a previously set variable on a DOM element. (6b128bf)
Bug Fixes
- pat inject: Fix closing of panels after successful inject. (3ff3b60)Fix case where close-panel event was suppressed while injection is in progress but suppressing was never released.
This prevented any other close-panel events from being handled properly.
Release 9.7.0-alpha.3
9.7.0-alpha.3 (2022-10-17)
Features
- core basepattern: Add one-time event listener registration method. (7df79e7)This implements the one-time listener from the Base pattern.
The listener helper is used in to wait for the pattern initialization to be finished.
Bug Fixes
- core base: Do not fail if initialized with an empty jQuery object. (34b14b4)
Release 9.7.0-alpha.2
9.7.0-alpha.2 (2022-10-15)
Features
-
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/[email protected]/dist/bundle.min.js
or
https://unpkg.com/@patternslib/[email protected]/dist/bundle.min.js -
Tests: Add $(":visible") pseudo selector for jQuery. (7e8ccf4)
Maintenance
-
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)
Release 9.7.0-alpha.1
9.7.0-alpha.1 (2022-10-11)
Features
-
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: #837
Fixes: quaive/ploneintranet.prototype#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 totrue
(the default isfalse
).
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 apat-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 apat-update
event and this
problem is fixed.
Bug Fixes
-
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
andchanged
event was thrown. Now we only throw achanged
event if da date was
selected. If no date was selected we throw ablur
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: highlightjs/highlight.js#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.
Maintenance
-
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)
Release 9.7.0-alpha.0
9.7.0-alpha.0 (2022-09-28)
Features
- Add class based base pattern. (5933a35)This is a new way to define Patterns by extending the BasePattern class and instantiating it on an element.
This is additionally to the old Base pattern approach or even the very old approach of just defining a Pattern following the specs.
The BasePattern class in core/basepattern uses JavaScript classes with all the object oriented benefits.
Yes, that might be syntactic sugar, but then again not.
For usage see: src/core/basepattern.md
Maintenance
- core registry: Support class based pattern initialization. (2c9e9dd)
Release 9.6.1
9.6.1 (2022-09-28)
Bug Fixes
- core dom: show/hide - do not set the hidden attribute. (af24138)In Chrome and Safari hidden but required input fields (e.g. hidden automatically by pat-autosuggest or pat-date-picker) cannot be submitted if they fail the browser's native validation.
The browser tries to set a validation message but fails because the element is not focusable.
See: https://stackoverflow.com/a/28340579/1337474
Release 9.6.0
9.6.0 (2022-09-28)
Features
-
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.
Maintenance
Release 9.5.0
9.5.0 (2022-09-27)
Features
- pat close panel: Better close-panel support. (fbc20a8)- Do not close panels when the form is invalid and submitted.
- Simplify the close panel logic by switching to event based triggering.
- Allow to postpone close panel events by pat-inject until successful
injection. - Simplify pat-modal's close-panel logic.
- pat validation: Add submit buttons to disable selector per default. (e6f8ba3)
Bug Fixes
-
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.
Maintenance
Release 9.4.0
9.4.0 (2022-09-23)
Features
-
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: #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: #945
Bug Fixes
-
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)