ku4web-components 6.4.80 → 6.4.81
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/angular/index.js +1 -1
- package/angular/index.mjs +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-aaf4fec9.js +6 -0
- package/dist/cjs/dom-14886762.js +75 -0
- package/dist/cjs/index-652a3cbf.js +14 -0
- package/dist/cjs/index-8e9e8864.js +3093 -0
- package/dist/cjs/{index-1e13241e.js → index-a9159bd6.js} +1 -1
- package/dist/cjs/index-c904eb3a.js +10 -0
- package/dist/cjs/{index-da3ed39d.js → index-f78c109e.js} +1 -1
- package/dist/cjs/ku4-carousel-controls.cjs.entry.js +10 -4
- package/dist/cjs/ku4-carousel-slide.cjs.entry.js +1 -1
- package/dist/cjs/ku4-carousel.cjs.entry.js +3 -3
- package/dist/cjs/ku4-col.cjs.entry.js +1 -1
- package/dist/cjs/ku4-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ku4-feature.cjs.entry.js +2 -2
- package/dist/cjs/ku4-focus-trap.cjs.entry.js +26 -26
- package/dist/cjs/ku4-form.cjs.entry.js +3 -3
- package/dist/cjs/ku4-grid.cjs.entry.js +1 -1
- package/dist/cjs/ku4-label.cjs.entry.js +2 -2
- package/dist/cjs/ku4-mask.cjs.entry.js +2 -2
- package/dist/cjs/ku4-modal.cjs.entry.js +3 -3
- package/dist/cjs/ku4-panel.cjs.entry.js +1 -1
- package/dist/cjs/ku4-preview.cjs.entry.js +43 -14
- package/dist/cjs/ku4-tab-list.cjs.entry.js +4 -4
- package/dist/cjs/ku4-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/ku4-tab.cjs.entry.js +3 -3
- package/dist/cjs/ku4-table.cjs.entry.js +1 -1
- package/dist/cjs/ku4-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/ku4-validation.cjs.entry.js +2 -2
- package/dist/cjs/ku4web-components.cjs.js +103 -8
- package/dist/cjs/loader.cjs.js +19 -3
- package/dist/cjs/{shadow-css-8940f82d.js → shadow-css-c44ea13a.js} +1 -1
- package/dist/cjs/{uid-d6942c42.js → uid-97baaecc.js} +1 -1
- package/dist/cjs/uid-eb3bec28.js +11 -0
- package/dist/collection/capabilities/a11y/aria.js +26 -0
- package/dist/collection/capabilities/angular/index.js +24 -0
- package/dist/collection/capabilities/decorators/deprecated.js +20 -0
- package/dist/collection/capabilities/decorators/index.js +3 -0
- package/dist/collection/capabilities/decorators/memoize.js +7 -0
- package/dist/collection/capabilities/dom/isFocusable.js +7 -0
- package/dist/collection/capabilities/dom/queryFocusable.js +2 -0
- package/dist/collection/capabilities/identity/uid.js +6 -0
- package/dist/collection/capabilities/mask/index.js +5 -0
- package/dist/collection/capabilities/mask/patterns/date.js +40 -0
- package/dist/collection/capabilities/mask/patterns/index.js +7 -0
- package/dist/collection/capabilities/react/index.js +25 -0
- package/dist/collection/capabilities/testing/html.js +14 -0
- package/dist/collection/capabilities/testing/styles.js +14 -0
- package/dist/collection/capabilities/vue/index.js +28 -0
- package/dist/collection/capabilities/vue3/index.js +26 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/ku4-carousel/ku4-carousel.css +221 -0
- package/dist/collection/components/ku4-carousel/ku4-carousel.js +362 -0
- package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.css +32 -0
- package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.js +112 -0
- package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.css +3 -0
- package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.js +159 -0
- package/dist/collection/components/ku4-col/ku4-col.css +601 -0
- package/dist/collection/components/ku4-col/ku4-col.js +288 -0
- package/dist/collection/components/ku4-drawer/ku4-drawer.css +56 -0
- package/dist/collection/components/ku4-drawer/ku4-drawer.js +163 -0
- package/dist/collection/components/ku4-feature/ku4-feature.js +70 -0
- package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.css +3 -0
- package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.js +441 -0
- package/dist/collection/components/ku4-form/ku4-form.js +225 -0
- package/dist/collection/components/ku4-grid/ku4-grid.css +751 -0
- package/dist/collection/components/ku4-grid/ku4-grid.js +408 -0
- package/dist/collection/components/ku4-label/ku4-label.css +36 -0
- package/dist/collection/components/ku4-label/ku4-label.js +115 -0
- package/dist/collection/components/ku4-mask/ku4-mask.css +3 -0
- package/dist/collection/components/ku4-mask/ku4-mask.js +458 -0
- package/dist/collection/components/ku4-modal/ku4-modal.css +85 -0
- package/dist/collection/components/ku4-modal/ku4-modal.js +208 -0
- package/dist/collection/components/ku4-panel/ku4-panel.css +14 -0
- package/dist/collection/components/ku4-panel/ku4-panel.js +119 -0
- package/dist/collection/components/ku4-preview/ku4-preview.css +23 -0
- package/dist/collection/components/ku4-preview/ku4-preview.js +266 -0
- package/dist/collection/components/ku4-tab/ku4-tab.css +82 -0
- package/dist/collection/components/ku4-tab/ku4-tab.js +191 -0
- package/dist/collection/components/ku4-tab-list/ku4-tab-list.css +6 -0
- package/dist/collection/components/ku4-tab-list/ku4-tab-list.js +118 -0
- package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.css +26 -0
- package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.js +166 -0
- package/dist/collection/components/ku4-table/ku4-table.css +116 -0
- package/dist/collection/components/ku4-table/ku4-table.js +120 -0
- package/dist/collection/components/ku4-tooltip/ku4-tooltip.css +56 -0
- package/dist/collection/components/ku4-tooltip/ku4-tooltip.js +274 -0
- package/dist/collection/components/ku4-validation/ku4-validation.css +19 -0
- package/dist/collection/components/ku4-validation/ku4-validation.js +364 -0
- package/dist/collection/components/ku4-validation/validate.js +14 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/security.js +27 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-091f949f.js +4 -0
- package/dist/esm/dom-a385e381.js +73 -0
- package/dist/esm/{index-9e3af5f4.js → index-26cde78a.js} +1 -1
- package/dist/esm/index-3e1e5aa3.js +3 -0
- package/dist/esm/index-516c5188.js +3057 -0
- package/dist/esm/index-7ff6e718.js +3 -0
- package/dist/esm/{index-20c3926d.js → index-bdb0771a.js} +1 -1
- package/dist/esm/ku4-carousel-controls.entry.js +10 -4
- package/dist/esm/ku4-carousel-slide.entry.js +1 -1
- package/dist/esm/ku4-carousel.entry.js +3 -3
- package/dist/esm/ku4-col.entry.js +1 -1
- package/dist/esm/ku4-drawer.entry.js +1 -1
- package/dist/esm/ku4-feature.entry.js +2 -2
- package/dist/esm/ku4-focus-trap.entry.js +3 -3
- package/dist/esm/ku4-form.entry.js +3 -3
- package/dist/esm/ku4-grid.entry.js +1 -1
- package/dist/esm/ku4-label.entry.js +2 -2
- package/dist/esm/ku4-mask.entry.js +2 -2
- package/dist/esm/ku4-modal.entry.js +3 -3
- package/dist/esm/ku4-panel.entry.js +1 -1
- package/dist/esm/ku4-preview.entry.js +34 -5
- package/dist/esm/ku4-tab-list.entry.js +4 -4
- package/dist/esm/ku4-tab-panel.entry.js +3 -3
- package/dist/esm/ku4-tab.entry.js +3 -3
- package/dist/esm/ku4-table.entry.js +1 -1
- package/dist/esm/ku4-tooltip.entry.js +2 -2
- package/dist/esm/ku4-validation.entry.js +2 -2
- package/dist/esm/ku4web-components.js +103 -8
- package/dist/esm/loader.js +19 -3
- package/dist/esm/{shadow-css-5d2d01ce.js → shadow-css-ef431969.js} +1 -1
- package/dist/esm/{uid-15f8c937.js → uid-1ec3509b.js} +1 -1
- package/dist/esm/uid-9dbd7ad0.js +9 -0
- package/dist/esm-es5/{index-9e3af5f4.js → index-26cde78a.js} +1 -1
- package/dist/esm-es5/{index-20c3926d.js → index-bdb0771a.js} +1 -1
- package/dist/esm-es5/ku4-carousel-controls.entry.js +1 -1
- package/dist/esm-es5/ku4-carousel-slide.entry.js +1 -1
- package/dist/esm-es5/ku4-carousel.entry.js +1 -1
- package/dist/esm-es5/ku4-col.entry.js +1 -1
- package/dist/esm-es5/ku4-drawer.entry.js +1 -1
- package/dist/esm-es5/ku4-feature.entry.js +1 -1
- package/dist/esm-es5/ku4-focus-trap.entry.js +1 -1
- package/dist/esm-es5/ku4-form.entry.js +1 -1
- package/dist/esm-es5/ku4-grid.entry.js +1 -1
- package/dist/esm-es5/ku4-label.entry.js +1 -1
- package/dist/esm-es5/ku4-mask.entry.js +1 -1
- package/dist/esm-es5/ku4-modal.entry.js +1 -1
- package/dist/esm-es5/ku4-panel.entry.js +1 -1
- package/dist/esm-es5/ku4-preview.entry.js +1 -1
- package/dist/esm-es5/ku4-tab-list.entry.js +1 -1
- package/dist/esm-es5/ku4-tab-panel.entry.js +1 -1
- package/dist/esm-es5/ku4-tab.entry.js +1 -1
- package/dist/esm-es5/ku4-table.entry.js +1 -1
- package/dist/esm-es5/ku4-tooltip.entry.js +1 -1
- package/dist/esm-es5/ku4-validation.entry.js +1 -1
- package/dist/esm-es5/ku4web-components.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{shadow-css-5d2d01ce.js → shadow-css-ef431969.js} +0 -0
- package/dist/esm-es5/uid-1ec3509b.js +1 -0
- package/dist/index.js +1 -1
- package/dist/ku4web-components/app-globals-0f993ce5.js +3 -0
- package/dist/ku4web-components/app-globals-497eb362.system.js +1 -0
- package/dist/ku4web-components/css-shim-091f949f.js +4 -0
- package/dist/ku4web-components/css-shim-c5bffe6b.system.js +1 -0
- package/dist/ku4web-components/dom-99eb7b76.system.js +21 -0
- package/dist/ku4web-components/dom-a385e381.js +73 -0
- package/dist/ku4web-components/index-380cbe3a.system.js +1 -0
- package/dist/ku4web-components/index-3e1e5aa3.js +3 -0
- package/dist/ku4web-components/index-516c5188.js +3057 -0
- package/dist/ku4web-components/index-7d482e8a.system.js +1 -0
- package/dist/ku4web-components/index-7ff6e718.js +3 -0
- package/dist/ku4web-components/index-fd0c89d0.system.js +1 -0
- package/dist/ku4web-components/index.esm.js +1 -0
- package/dist/ku4web-components/index.system.js +1 -0
- package/dist/ku4web-components/ku4-carousel-controls.entry.js +89 -0
- package/dist/ku4web-components/ku4-carousel-controls.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-carousel-slide.entry.js +47 -0
- package/dist/ku4web-components/ku4-carousel-slide.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-carousel.entry.js +168 -0
- package/dist/ku4web-components/ku4-carousel.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-col.entry.js +75 -0
- package/dist/ku4web-components/ku4-col.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-drawer.entry.js +35 -0
- package/dist/ku4web-components/ku4-drawer.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-feature.entry.js +29 -0
- package/dist/ku4web-components/ku4-feature.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-focus-trap.entry.js +323 -0
- package/dist/ku4web-components/ku4-focus-trap.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-form.entry.js +112 -0
- package/dist/ku4web-components/ku4-form.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-grid.entry.js +108 -0
- package/dist/ku4web-components/ku4-grid.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-label.entry.js +70 -0
- package/dist/ku4web-components/ku4-label.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-mask.entry.js +342 -0
- package/dist/ku4web-components/ku4-mask.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-modal.entry.js +75 -0
- package/dist/ku4web-components/ku4-modal.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-panel.entry.js +49 -0
- package/dist/ku4web-components/ku4-panel.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-preview.entry.js +128 -0
- package/dist/ku4web-components/ku4-preview.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tab-list.entry.js +76 -0
- package/dist/ku4web-components/ku4-tab-list.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tab-panel.entry.js +72 -0
- package/dist/ku4web-components/ku4-tab-panel.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tab.entry.js +63 -0
- package/dist/ku4web-components/ku4-tab.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-table.entry.js +79 -0
- package/dist/ku4web-components/ku4-table.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-tooltip.entry.js +120 -0
- package/dist/ku4web-components/ku4-tooltip.system.entry.js +1 -0
- package/dist/ku4web-components/ku4-validation.entry.js +162 -0
- package/dist/ku4web-components/ku4-validation.system.entry.js +1 -0
- package/dist/ku4web-components/ku4web-components.css +299 -1
- package/dist/ku4web-components/ku4web-components.esm.js +129 -1
- package/dist/ku4web-components/ku4web-components.js +1 -1
- package/dist/ku4web-components/ku4web-components.system.js +1 -0
- package/dist/ku4web-components/p-019be0a7.entry.js +1 -0
- package/dist/ku4web-components/{p-8f480cb5.system.entry.js → p-01ae9e4c.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-02e342f7.system.entry.js → p-03d6fb35.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-3c182b2f.entry.js → p-0c05c4ad.entry.js} +1 -1
- package/dist/ku4web-components/{p-04948520.system.entry.js → p-0cc659d9.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-2aac6c90.js → p-0ded083e.js} +1 -1
- package/dist/ku4web-components/{p-761b2cbc.system.entry.js → p-0e222607.system.entry.js} +1 -1
- package/dist/ku4web-components/p-17d548db.js +1 -0
- package/dist/ku4web-components/{p-c1068ffa.js → p-189cde73.js} +1 -1
- package/dist/ku4web-components/{p-2f2d74dc.system.entry.js → p-2300b0b7.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-8faad87d.entry.js → p-25ca27d4.entry.js} +1 -1
- package/dist/ku4web-components/{p-f1cc1b2d.entry.js → p-2a6d5089.entry.js} +1 -1
- package/dist/ku4web-components/{p-9c0d71af.system.entry.js → p-341081d6.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-e4ff1c36.entry.js → p-55d15007.entry.js} +1 -1
- package/dist/ku4web-components/{p-d6ec34c3.entry.js → p-57ec7c89.entry.js} +1 -1
- package/dist/ku4web-components/{p-15ee8b8e.system.entry.js → p-5d6cf40f.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-01debe28.system.entry.js → p-5eb48119.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-67adc5b1.system.entry.js → p-64bcfdeb.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-71d57b8b.system.js → p-6bf18c7c.system.js} +0 -0
- package/dist/ku4web-components/{p-0eb73a0f.system.entry.js → p-6c5699e3.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-840704e4.entry.js → p-6d63d17d.entry.js} +1 -1
- package/dist/ku4web-components/{p-f06bf0ae.entry.js → p-6f47f245.entry.js} +1 -1
- package/dist/ku4web-components/{p-b4488a7d.system.entry.js → p-75161edb.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-0e010c10.system.entry.js → p-801fab11.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-0f8708f8.entry.js → p-8c0cb5c1.entry.js} +1 -1
- package/dist/ku4web-components/{p-2edd35f8.system.entry.js → p-92bc6bf1.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-7273db60.entry.js → p-94dd5fad.entry.js} +1 -1
- package/dist/ku4web-components/{p-660ebd19.entry.js → p-993123b6.entry.js} +1 -1
- package/dist/ku4web-components/{p-c50540ec.system.entry.js → p-9f1bc248.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-f6455ab3.js → p-b10887b2.js} +0 -0
- package/dist/ku4web-components/{p-a5c7f5f7.system.entry.js → p-b3bdc458.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-d360c64a.entry.js → p-b60c60e4.entry.js} +1 -1
- package/dist/ku4web-components/{p-0785fc39.system.js → p-c3293202.system.js} +1 -1
- package/dist/ku4web-components/{p-7a47027b.entry.js → p-c459bbb7.entry.js} +1 -1
- package/dist/ku4web-components/{p-90c37394.entry.js → p-c62c66be.entry.js} +1 -1
- package/dist/ku4web-components/{p-c19fd841.entry.js → p-c646a177.entry.js} +1 -1
- package/dist/ku4web-components/{p-8e2fca0b.system.entry.js → p-ca547c71.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-ce6eddc3.system.entry.js → p-d6f80a73.system.entry.js} +1 -1
- package/dist/ku4web-components/p-db3040f3.system.js +1 -0
- package/dist/ku4web-components/{p-19a8c0f6.system.entry.js → p-db493d59.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-77f1853c.entry.js → p-dc35b1af.entry.js} +1 -1
- package/dist/ku4web-components/p-deb02b56.entry.js +1 -0
- package/dist/ku4web-components/{p-3874127d.entry.js → p-df1544c7.entry.js} +1 -1
- package/dist/ku4web-components/{p-22eed87f.entry.js → p-e10de631.entry.js} +1 -1
- package/dist/ku4web-components/{p-8d9eb18b.system.entry.js → p-e29d66a7.system.entry.js} +1 -1
- package/dist/ku4web-components/{p-f0b1c07c.system.js → p-e2ae0504.system.js} +1 -1
- package/dist/ku4web-components/p-e641f14e.system.js +1 -0
- package/dist/ku4web-components/{p-adddaeef.entry.js → p-e6937d21.entry.js} +1 -1
- package/dist/ku4web-components/{p-232787a5.system.entry.js → p-f0e309a9.system.entry.js} +1 -1
- package/dist/ku4web-components/shadow-css-27708fdd.system.js +13 -0
- package/dist/ku4web-components/shadow-css-ef431969.js +388 -0
- package/dist/ku4web-components/uid-9dbd7ad0.js +9 -0
- package/dist/ku4web-components/uid-fb867945.system.js +1 -0
- package/dist/types/components/ku4-carousel-controls/ku4-carousel-controls.d.ts +1 -0
- package/dist/types/components/ku4-carousel-slide/ku4-carousel-slide.d.ts +6 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +15 -15
- package/react/index.js +1 -1
- package/react/index.mjs +1 -1
- package/vue/index.js +1 -1
- package/vue/index.mjs +1 -1
- package/vue3/index.js +1 -1
- package/vue3/index.mjs +1 -1
- package/dist/esm-es5/uid-15f8c937.js +0 -1
- package/dist/ku4web-components/p-b590da20.entry.js +0 -1
- package/dist/ku4web-components/p-be7890a1.system.js +0 -1
- package/dist/ku4web-components/p-cbbb4b1b.js +0 -1
- package/dist/ku4web-components/p-eb58b04b.system.js +0 -1
- package/dist/ku4web-components/p-eb6882c8.entry.js +0 -1
@@ -0,0 +1,388 @@
|
|
1
|
+
/*
|
2
|
+
Stencil Client Platform v2.14.2 | MIT Licensed | https://stenciljs.com
|
3
|
+
*/
|
4
|
+
/**
|
5
|
+
* @license
|
6
|
+
* Copyright Google Inc. All Rights Reserved.
|
7
|
+
*
|
8
|
+
* Use of this source code is governed by an MIT-style license that can be
|
9
|
+
* found in the LICENSE file at https://angular.io/license
|
10
|
+
*
|
11
|
+
* This file is a port of shadowCSS from webcomponents.js to TypeScript.
|
12
|
+
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
|
13
|
+
* https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
|
14
|
+
*/
|
15
|
+
const safeSelector = (selector) => {
|
16
|
+
const placeholders = [];
|
17
|
+
let index = 0;
|
18
|
+
let content;
|
19
|
+
// Replaces attribute selectors with placeholders.
|
20
|
+
// The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
|
21
|
+
selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
|
22
|
+
const replaceBy = `__ph-${index}__`;
|
23
|
+
placeholders.push(keep);
|
24
|
+
index++;
|
25
|
+
return replaceBy;
|
26
|
+
});
|
27
|
+
// Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
|
28
|
+
// WS and "+" would otherwise be interpreted as selector separators.
|
29
|
+
content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
|
30
|
+
const replaceBy = `__ph-${index}__`;
|
31
|
+
placeholders.push(exp);
|
32
|
+
index++;
|
33
|
+
return pseudo + replaceBy;
|
34
|
+
});
|
35
|
+
const ss = {
|
36
|
+
content,
|
37
|
+
placeholders,
|
38
|
+
};
|
39
|
+
return ss;
|
40
|
+
};
|
41
|
+
const restoreSafeSelector = (placeholders, content) => {
|
42
|
+
return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
|
43
|
+
};
|
44
|
+
const _polyfillHost = '-shadowcsshost';
|
45
|
+
const _polyfillSlotted = '-shadowcssslotted';
|
46
|
+
// note: :host-context pre-processed to -shadowcsshostcontext.
|
47
|
+
const _polyfillHostContext = '-shadowcsscontext';
|
48
|
+
const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
|
49
|
+
const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
|
50
|
+
const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
|
51
|
+
const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
|
52
|
+
const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
|
53
|
+
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
54
|
+
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
55
|
+
const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
|
56
|
+
const _polyfillHostRe = /-shadowcsshost/gim;
|
57
|
+
const _colonHostRe = /:host/gim;
|
58
|
+
const _colonSlottedRe = /::slotted/gim;
|
59
|
+
const _colonHostContextRe = /:host-context/gim;
|
60
|
+
const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
|
61
|
+
const stripComments = (input) => {
|
62
|
+
return input.replace(_commentRe, '');
|
63
|
+
};
|
64
|
+
const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
|
65
|
+
const extractCommentsWithHash = (input) => {
|
66
|
+
return input.match(_commentWithHashRe) || [];
|
67
|
+
};
|
68
|
+
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
69
|
+
const _curlyRe = /([{}])/g;
|
70
|
+
const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
|
71
|
+
const OPEN_CURLY = '{';
|
72
|
+
const CLOSE_CURLY = '}';
|
73
|
+
const BLOCK_PLACEHOLDER = '%BLOCK%';
|
74
|
+
const processRules = (input, ruleCallback) => {
|
75
|
+
const inputWithEscapedBlocks = escapeBlocks(input);
|
76
|
+
let nextBlockIndex = 0;
|
77
|
+
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
|
78
|
+
const selector = m[2];
|
79
|
+
let content = '';
|
80
|
+
let suffix = m[4];
|
81
|
+
let contentPrefix = '';
|
82
|
+
if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
|
83
|
+
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
|
84
|
+
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
|
85
|
+
contentPrefix = '{';
|
86
|
+
}
|
87
|
+
const cssRule = {
|
88
|
+
selector,
|
89
|
+
content,
|
90
|
+
};
|
91
|
+
const rule = ruleCallback(cssRule);
|
92
|
+
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
93
|
+
});
|
94
|
+
};
|
95
|
+
const escapeBlocks = (input) => {
|
96
|
+
const inputParts = input.split(_curlyRe);
|
97
|
+
const resultParts = [];
|
98
|
+
const escapedBlocks = [];
|
99
|
+
let bracketCount = 0;
|
100
|
+
let currentBlockParts = [];
|
101
|
+
for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
|
102
|
+
const part = inputParts[partIndex];
|
103
|
+
if (part === CLOSE_CURLY) {
|
104
|
+
bracketCount--;
|
105
|
+
}
|
106
|
+
if (bracketCount > 0) {
|
107
|
+
currentBlockParts.push(part);
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
if (currentBlockParts.length > 0) {
|
111
|
+
escapedBlocks.push(currentBlockParts.join(''));
|
112
|
+
resultParts.push(BLOCK_PLACEHOLDER);
|
113
|
+
currentBlockParts = [];
|
114
|
+
}
|
115
|
+
resultParts.push(part);
|
116
|
+
}
|
117
|
+
if (part === OPEN_CURLY) {
|
118
|
+
bracketCount++;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
if (currentBlockParts.length > 0) {
|
122
|
+
escapedBlocks.push(currentBlockParts.join(''));
|
123
|
+
resultParts.push(BLOCK_PLACEHOLDER);
|
124
|
+
}
|
125
|
+
const strEscapedBlocks = {
|
126
|
+
escapedString: resultParts.join(''),
|
127
|
+
blocks: escapedBlocks,
|
128
|
+
};
|
129
|
+
return strEscapedBlocks;
|
130
|
+
};
|
131
|
+
const insertPolyfillHostInCssText = (selector) => {
|
132
|
+
selector = selector
|
133
|
+
.replace(_colonHostContextRe, _polyfillHostContext)
|
134
|
+
.replace(_colonHostRe, _polyfillHost)
|
135
|
+
.replace(_colonSlottedRe, _polyfillSlotted);
|
136
|
+
return selector;
|
137
|
+
};
|
138
|
+
const convertColonRule = (cssText, regExp, partReplacer) => {
|
139
|
+
// m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
|
140
|
+
return cssText.replace(regExp, (...m) => {
|
141
|
+
if (m[2]) {
|
142
|
+
const parts = m[2].split(',');
|
143
|
+
const r = [];
|
144
|
+
for (let i = 0; i < parts.length; i++) {
|
145
|
+
const p = parts[i].trim();
|
146
|
+
if (!p)
|
147
|
+
break;
|
148
|
+
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
|
149
|
+
}
|
150
|
+
return r.join(',');
|
151
|
+
}
|
152
|
+
else {
|
153
|
+
return _polyfillHostNoCombinator + m[3];
|
154
|
+
}
|
155
|
+
});
|
156
|
+
};
|
157
|
+
const colonHostPartReplacer = (host, part, suffix) => {
|
158
|
+
return host + part.replace(_polyfillHost, '') + suffix;
|
159
|
+
};
|
160
|
+
const convertColonHost = (cssText) => {
|
161
|
+
return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
|
162
|
+
};
|
163
|
+
const colonHostContextPartReplacer = (host, part, suffix) => {
|
164
|
+
if (part.indexOf(_polyfillHost) > -1) {
|
165
|
+
return colonHostPartReplacer(host, part, suffix);
|
166
|
+
}
|
167
|
+
else {
|
168
|
+
return host + part + suffix + ', ' + part + ' ' + host + suffix;
|
169
|
+
}
|
170
|
+
};
|
171
|
+
const convertColonSlotted = (cssText, slotScopeId) => {
|
172
|
+
const slotClass = '.' + slotScopeId + ' > ';
|
173
|
+
const selectors = [];
|
174
|
+
cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
|
175
|
+
if (m[2]) {
|
176
|
+
const compound = m[2].trim();
|
177
|
+
const suffix = m[3];
|
178
|
+
const slottedSelector = slotClass + compound + suffix;
|
179
|
+
let prefixSelector = '';
|
180
|
+
for (let i = m[4] - 1; i >= 0; i--) {
|
181
|
+
const char = m[5][i];
|
182
|
+
if (char === '}' || char === ',') {
|
183
|
+
break;
|
184
|
+
}
|
185
|
+
prefixSelector = char + prefixSelector;
|
186
|
+
}
|
187
|
+
const orgSelector = prefixSelector + slottedSelector;
|
188
|
+
const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
|
189
|
+
if (orgSelector.trim() !== addedSelector.trim()) {
|
190
|
+
const updatedSelector = `${addedSelector}, ${orgSelector}`;
|
191
|
+
selectors.push({
|
192
|
+
orgSelector,
|
193
|
+
updatedSelector,
|
194
|
+
});
|
195
|
+
}
|
196
|
+
return slottedSelector;
|
197
|
+
}
|
198
|
+
else {
|
199
|
+
return _polyfillHostNoCombinator + m[3];
|
200
|
+
}
|
201
|
+
});
|
202
|
+
return {
|
203
|
+
selectors,
|
204
|
+
cssText,
|
205
|
+
};
|
206
|
+
};
|
207
|
+
const convertColonHostContext = (cssText) => {
|
208
|
+
return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
|
209
|
+
};
|
210
|
+
const convertShadowDOMSelectors = (cssText) => {
|
211
|
+
return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
|
212
|
+
};
|
213
|
+
const makeScopeMatcher = (scopeSelector) => {
|
214
|
+
const lre = /\[/g;
|
215
|
+
const rre = /\]/g;
|
216
|
+
scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
|
217
|
+
return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
|
218
|
+
};
|
219
|
+
const selectorNeedsScoping = (selector, scopeSelector) => {
|
220
|
+
const re = makeScopeMatcher(scopeSelector);
|
221
|
+
return !re.test(selector);
|
222
|
+
};
|
223
|
+
const injectScopingSelector = (selector, scopingSelector) => {
|
224
|
+
return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
|
225
|
+
return before + scopingSelector + colon + after;
|
226
|
+
});
|
227
|
+
};
|
228
|
+
const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
|
229
|
+
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
|
230
|
+
_polyfillHostRe.lastIndex = 0;
|
231
|
+
if (_polyfillHostRe.test(selector)) {
|
232
|
+
const replaceBy = `.${hostSelector}`;
|
233
|
+
return selector
|
234
|
+
.replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
|
235
|
+
.replace(_polyfillHostRe, replaceBy + ' ');
|
236
|
+
}
|
237
|
+
return scopeSelector + ' ' + selector;
|
238
|
+
};
|
239
|
+
const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
|
240
|
+
const isRe = /\[is=([^\]]*)\]/g;
|
241
|
+
scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
|
242
|
+
const className = '.' + scopeSelector;
|
243
|
+
const _scopeSelectorPart = (p) => {
|
244
|
+
let scopedP = p.trim();
|
245
|
+
if (!scopedP) {
|
246
|
+
return '';
|
247
|
+
}
|
248
|
+
if (p.indexOf(_polyfillHostNoCombinator) > -1) {
|
249
|
+
scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
|
250
|
+
}
|
251
|
+
else {
|
252
|
+
// remove :host since it should be unnecessary
|
253
|
+
const t = p.replace(_polyfillHostRe, '');
|
254
|
+
if (t.length > 0) {
|
255
|
+
scopedP = injectScopingSelector(t, className);
|
256
|
+
}
|
257
|
+
}
|
258
|
+
return scopedP;
|
259
|
+
};
|
260
|
+
const safeContent = safeSelector(selector);
|
261
|
+
selector = safeContent.content;
|
262
|
+
let scopedSelector = '';
|
263
|
+
let startIndex = 0;
|
264
|
+
let res;
|
265
|
+
const sep = /( |>|\+|~(?!=))\s*/g;
|
266
|
+
// If a selector appears before :host it should not be shimmed as it
|
267
|
+
// matches on ancestor elements and not on elements in the host's shadow
|
268
|
+
// `:host-context(div)` is transformed to
|
269
|
+
// `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
|
270
|
+
// the `div` is not part of the component in the 2nd selectors and should not be scoped.
|
271
|
+
// Historically `component-tag:host` was matching the component so we also want to preserve
|
272
|
+
// this behavior to avoid breaking legacy apps (it should not match).
|
273
|
+
// The behavior should be:
|
274
|
+
// - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
|
275
|
+
// - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
|
276
|
+
// `:host-context(tag)`)
|
277
|
+
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
278
|
+
// Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
|
279
|
+
let shouldScope = !hasHost;
|
280
|
+
while ((res = sep.exec(selector)) !== null) {
|
281
|
+
const separator = res[1];
|
282
|
+
const part = selector.slice(startIndex, res.index).trim();
|
283
|
+
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
284
|
+
const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
|
285
|
+
scopedSelector += `${scopedPart} ${separator} `;
|
286
|
+
startIndex = sep.lastIndex;
|
287
|
+
}
|
288
|
+
const part = selector.substring(startIndex);
|
289
|
+
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
290
|
+
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
291
|
+
// replace the placeholders with their original values
|
292
|
+
return restoreSafeSelector(safeContent.placeholders, scopedSelector);
|
293
|
+
};
|
294
|
+
const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
|
295
|
+
return selector
|
296
|
+
.split(',')
|
297
|
+
.map((shallowPart) => {
|
298
|
+
if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
|
299
|
+
return shallowPart.trim();
|
300
|
+
}
|
301
|
+
if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
|
302
|
+
return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
|
303
|
+
}
|
304
|
+
else {
|
305
|
+
return shallowPart.trim();
|
306
|
+
}
|
307
|
+
})
|
308
|
+
.join(', ');
|
309
|
+
};
|
310
|
+
const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
|
311
|
+
return processRules(cssText, (rule) => {
|
312
|
+
let selector = rule.selector;
|
313
|
+
let content = rule.content;
|
314
|
+
if (rule.selector[0] !== '@') {
|
315
|
+
selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
|
316
|
+
}
|
317
|
+
else if (rule.selector.startsWith('@media') ||
|
318
|
+
rule.selector.startsWith('@supports') ||
|
319
|
+
rule.selector.startsWith('@page') ||
|
320
|
+
rule.selector.startsWith('@document')) {
|
321
|
+
content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
|
322
|
+
}
|
323
|
+
const cssRule = {
|
324
|
+
selector: selector.replace(/\s{2,}/g, ' ').trim(),
|
325
|
+
content,
|
326
|
+
};
|
327
|
+
return cssRule;
|
328
|
+
});
|
329
|
+
};
|
330
|
+
const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
|
331
|
+
cssText = insertPolyfillHostInCssText(cssText);
|
332
|
+
cssText = convertColonHost(cssText);
|
333
|
+
cssText = convertColonHostContext(cssText);
|
334
|
+
const slotted = convertColonSlotted(cssText, slotScopeId);
|
335
|
+
cssText = slotted.cssText;
|
336
|
+
cssText = convertShadowDOMSelectors(cssText);
|
337
|
+
if (scopeId) {
|
338
|
+
cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
|
339
|
+
}
|
340
|
+
cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
|
341
|
+
cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
|
342
|
+
return {
|
343
|
+
cssText: cssText.trim(),
|
344
|
+
slottedSelectors: slotted.selectors,
|
345
|
+
};
|
346
|
+
};
|
347
|
+
const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
348
|
+
const hostScopeId = scopeId + '-h';
|
349
|
+
const slotScopeId = scopeId + '-s';
|
350
|
+
const commentsWithHash = extractCommentsWithHash(cssText);
|
351
|
+
cssText = stripComments(cssText);
|
352
|
+
const orgSelectors = [];
|
353
|
+
if (commentOriginalSelector) {
|
354
|
+
const processCommentedSelector = (rule) => {
|
355
|
+
const placeholder = `/*!@___${orgSelectors.length}___*/`;
|
356
|
+
const comment = `/*!@${rule.selector}*/`;
|
357
|
+
orgSelectors.push({ placeholder, comment });
|
358
|
+
rule.selector = placeholder + rule.selector;
|
359
|
+
return rule;
|
360
|
+
};
|
361
|
+
cssText = processRules(cssText, (rule) => {
|
362
|
+
if (rule.selector[0] !== '@') {
|
363
|
+
return processCommentedSelector(rule);
|
364
|
+
}
|
365
|
+
else if (rule.selector.startsWith('@media') ||
|
366
|
+
rule.selector.startsWith('@supports') ||
|
367
|
+
rule.selector.startsWith('@page') ||
|
368
|
+
rule.selector.startsWith('@document')) {
|
369
|
+
rule.content = processRules(rule.content, processCommentedSelector);
|
370
|
+
return rule;
|
371
|
+
}
|
372
|
+
return rule;
|
373
|
+
});
|
374
|
+
}
|
375
|
+
const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
|
376
|
+
cssText = [scoped.cssText, ...commentsWithHash].join('\n');
|
377
|
+
if (commentOriginalSelector) {
|
378
|
+
orgSelectors.forEach(({ placeholder, comment }) => {
|
379
|
+
cssText = cssText.replace(placeholder, comment);
|
380
|
+
});
|
381
|
+
}
|
382
|
+
scoped.slottedSelectors.forEach((slottedSelector) => {
|
383
|
+
cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
|
384
|
+
});
|
385
|
+
return cssText;
|
386
|
+
};
|
387
|
+
|
388
|
+
export { scopeCss };
|
@@ -0,0 +1 @@
|
|
1
|
+
System.register(["./index-380cbe3a.system.js"],(function(t){"use strict";var e;return{setters:[function(t){e=t.R}],execute:function(){var n=t("u",(function(){var t;return function(){t=e.uid()}()}))}}}));
|
@@ -2,6 +2,12 @@
|
|
2
2
|
* @description ku4-carousel-slide
|
3
3
|
*/
|
4
4
|
export declare class Ku4CarouselSlide {
|
5
|
+
/**
|
6
|
+
* Name of slide. The value of this property can be used as the
|
7
|
+
* value of the "slide" attribute of a ku4-carousel-control to
|
8
|
+
* target this slide as the active slide for the target ku4-carousel-control
|
9
|
+
*/
|
10
|
+
readonly name: any;
|
5
11
|
private active;
|
6
12
|
private classList;
|
7
13
|
/**
|
@@ -60,6 +60,10 @@ export namespace Components {
|
|
60
60
|
* Set this slide to inactive.
|
61
61
|
*/
|
62
62
|
"deactivate": () => Promise<void>;
|
63
|
+
/**
|
64
|
+
* Name of slide. The value of this property can be used as the value of the "slide" attribute of a ku4-carousel-control to target this slide as the active slide for the target ku4-carousel-control
|
65
|
+
*/
|
66
|
+
"name": any;
|
63
67
|
/**
|
64
68
|
* Move this slide in to view.
|
65
69
|
* @param direction - Direction to move.
|
@@ -718,6 +722,10 @@ declare namespace LocalJSX {
|
|
718
722
|
"for"?: string;
|
719
723
|
}
|
720
724
|
interface Ku4CarouselSlide {
|
725
|
+
/**
|
726
|
+
* Name of slide. The value of this property can be used as the value of the "slide" attribute of a ku4-carousel-control to target this slide as the active slide for the target ku4-carousel-control
|
727
|
+
*/
|
728
|
+
"name"?: any;
|
721
729
|
}
|
722
730
|
interface Ku4Col {
|
723
731
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ku4web-components",
|
3
|
-
"version": "6.4.
|
3
|
+
"version": "6.4.81",
|
4
4
|
"description": "kodmunki™ Web Components",
|
5
5
|
"main": "./dist/index.cjs.js",
|
6
6
|
"module": "./dist/index.js",
|
@@ -54,12 +54,12 @@
|
|
54
54
|
"stencil:test"
|
55
55
|
],
|
56
56
|
"devDependencies": {
|
57
|
-
"@babel/core": "^7.17.
|
57
|
+
"@babel/core": "^7.17.8",
|
58
58
|
"@jest/core": "^27.5.0",
|
59
59
|
"@rollup/plugin-babel": "^5.3.1",
|
60
|
-
"@rollup/plugin-commonjs": "^21.0.
|
60
|
+
"@rollup/plugin-commonjs": "^21.0.3",
|
61
61
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
62
|
-
"@stencil/core": "^2.14.
|
62
|
+
"@stencil/core": "^2.14.2",
|
63
63
|
"@stencil/eslint-plugin": "^0.4.0",
|
64
64
|
"@stencil/sass": "^1.4.0",
|
65
65
|
"@storybook/addon-actions": "^6.4.19",
|
@@ -73,37 +73,37 @@
|
|
73
73
|
"@storybook/react": "^6.4.19",
|
74
74
|
"@storybook/theming": "^6.4.19",
|
75
75
|
"@storybook/web-components": "^6.4.19",
|
76
|
-
"@types/node": "^17.0.
|
76
|
+
"@types/node": "^17.0.23",
|
77
77
|
"@types/puppeteer": "^5.4.5",
|
78
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
79
|
-
"@typescript-eslint/parser": "^5.
|
78
|
+
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
79
|
+
"@typescript-eslint/parser": "^5.16.0",
|
80
80
|
"acorn": "^8.1.0",
|
81
|
-
"babel-loader": "^8.2.
|
81
|
+
"babel-loader": "^8.2.4",
|
82
82
|
"bufferutil": "^4.0.3",
|
83
|
-
"canvas": "^2.9.
|
83
|
+
"canvas": "^2.9.1",
|
84
84
|
"core-js": "^3.21.1",
|
85
85
|
"css-loader": "^5.2.7",
|
86
|
-
"eslint": "^8.
|
87
|
-
"eslint-plugin-react": "^7.29.
|
86
|
+
"eslint": "^8.12.0",
|
87
|
+
"eslint-plugin-react": "^7.29.4",
|
88
88
|
"fibers": "^5.0.1",
|
89
89
|
"html-to-react": "^1.4.8",
|
90
90
|
"jest": "^27.5.0",
|
91
91
|
"jest-cli": "^27.5.0",
|
92
|
-
"ku4es-kernel": "^8.
|
92
|
+
"ku4es-kernel": "^8.4.1",
|
93
93
|
"ku4es-ui-data": "^3.1.7",
|
94
94
|
"ku4es-ui-kernel": "^8.0.7",
|
95
|
-
"lit-html": "^2.2.
|
95
|
+
"lit-html": "^2.2.1",
|
96
96
|
"node-sass": "^5.0.0",
|
97
97
|
"pre-commit": "^1.2.2",
|
98
98
|
"puppeteer": "^13.5.1",
|
99
|
-
"rollup": "^2.70.
|
99
|
+
"rollup": "^2.70.1",
|
100
100
|
"rollup-plugin-cleanup": "^3.2.1",
|
101
101
|
"rollup-plugin-terser": "^7.0.2",
|
102
102
|
"sass": "^1.49.9",
|
103
103
|
"sass-loader": "^10.2.1",
|
104
104
|
"style-loader": "^2.0.0",
|
105
105
|
"ts-dedent": "^2.0.0",
|
106
|
-
"typescript": "^4.6.
|
106
|
+
"typescript": "^4.6.3",
|
107
107
|
"utf-8-validate": "^5.0.9",
|
108
108
|
"vue": "^2.6.12",
|
109
109
|
"webpack": "^4.44.2"
|
package/react/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";function t(t,r,e,n,i,s,a){try{var u=t[s](a),o=u.value}catch(t){return void e(t)}u.done?r(o):Promise.resolve(o).then(n,i)}function r(r){return function(){var e=this,n=arguments;return new Promise((function(i,s){var a=r.apply(e,n);function u(r){t(a,i,s,u,o,"next",r)}function o(r){t(a,i,s,u,o,"throw",r)}u(void 0)}))}}Object.defineProperty(exports,"__esModule",{value:!0});class e{static isNull(t){return null===t}static isEmpty(t){return e.isString(t)&&""===t||e.isArray(t)&&t.length<1||e.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(e.isUndefined(t)||e.isNull(t))}static isNullOrEmpty(t){return!e.exists(t)||e.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return e.isBool(t)&&!0===t}static isFalse(t){return e.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||e.isFunction(t)&&/^async/.test(t.toString())||e.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return e.exists(t)&&"object"==typeof t&&!(e.isBool(t)||e.isNumber(t)||e.isDate(t)||e.isArray(t)||e.isString(t)||e.isFunction(t))}static isObjectLiteral(t){return e.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!e.isFalsy(t)}static isFalsy(t){return e.isZero(t)||e.isFalse(t)||e.isNullOrEmpty(t)||isNaN(t)}}function n(t){return e.exists(t)&&e.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function i(t){return e.exists(t)&&e.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function s(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function a(t,r=0){return s(t+5*Math.pow(10,r-1),r)}function u(t,r=0){return 0===t?0:s(t-5*Math.pow(10,r-1),r)}function o(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function c(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function l(){return Math.random().toString().substr(2)}function h(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,r=0){if(!e.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return n(i(t))},trimStart:n,trimEnd:i,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,n="_"){return e.isFunction(r)?r(t):e.isString(r)&&t.split("").reduce(((t,r)=>t.replace(new RegExp(n),r)),r)},unmask:function(t,r,n="_"){const i=new RegExp(n);return e.isFunction(r)?r(t):e.isString(r)&&t.split("").reduce(((t,e,n)=>!i.test(e)&&i.test(r.charAt(n))?t+e:t),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:s,roundUp:a,roundDown:u,roundTowardZero:function(t,r=0){return t<0?a(t,r):u(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:o,fib2:c,fibArray:function(t){return Array(t).fill(0).map((()=>o(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>c(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:l,uuid:h,suid:function(){return Symbol(l())},suuid:function(){return Symbol(h())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class f{static isNull(t){return null===t}static isEmpty(t){return f.isString(t)&&""===t||f.isArray(t)&&t.length<1||f.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(f.isUndefined(t)||f.isNull(t))}static isNullOrEmpty(t){return!f.exists(t)||f.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return f.isBool(t)&&!0===t}static isFalse(t){return f.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||f.isFunction(t)&&/^async/.test(t.toString())||f.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return f.exists(t)&&"object"==typeof t&&!(f.isBool(t)||f.isNumber(t)||f.isDate(t)||f.isArray(t)||f.isString(t)||f.isFunction(t))}static isObjectLiteral(t){return f.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!f.isFalsy(t)}static isFalsy(t){return f.isZero(t)||f.isFalse(t)||f.isNullOrEmpty(t)||isNaN(t)}}function p(...t){return"".concat(...t)}function d(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function y(t){return m(g(t))}function m(t){return f.exists(t)&&f.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function g(t){return f.exists(t)&&f.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function _(t,r){try{return t()}catch{return r}}let b;Object.freeze({__proto__:null,build:p,chunk:function(t,r=0){if(!f.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:d,trim:y,trimStart:m,trimEnd:g,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){return f.isFunction(r)?r(t):f.isString(r)&&t.split("").reduce(((t,r)=>t.replace(new RegExp(e),r)),r)},unmask:function(t,r,e="_"){const n=new RegExp(e);return f.isFunction(r)?r(t):f.isString(r)&&t.split("").reduce(((t,e,i)=>!n.test(e)&&n.test(r.charAt(i))?t+e:t),"")}}),_.async=async(t,r)=>{try{return await t()}catch{return r}};class w{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>N(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return A(this._year)}get nextDay(){return F(this,1,0,0)}get prevDay(){return F(this,-1,0,0)}get nextMonth(){return F(this,0,1,0)}get prevMonth(){return F(this,0,-1,0)}get nextYear(){return F(this,0,0,1)}get prevYear(){return F(this,0,0,-1)}get firstDayOfMonth(){return new w(this._year,this._month,1)}get lastDayOfMonth(){return new w(this._year,this._month,N(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),u=i(r),o=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),u,c),a,o)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return d(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return f.isString(t)||f.isNumber(t)||f.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof w}static parse(t){if(t instanceof w)return t;let r=f.isString(t)?y(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!f.exists(r)||Number.isNaN(e.valueOf()))throw new Error(d("Cannot parse value= {0}",r));return new w(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return _((()=>w.parse(t)),null)}static assumeNow(t){b=w.parse(t)}static get today(){return b||w.parse(new Date)}}function N(t,r){return 2===t?A(r)?29:28:t<8&&f.isEven(t)||t>7&&f.isOdd(t)?30:31}function A(t){const r=t.toString().split(/\B/);return parseFloat(p(r[r.length-2],r[r.length-1]))%4==0}function F(t,r,e,n){const i=t.month,s=t.year,a=t.date,u=e,o=n;let c=a+r,l=i+u,h=s+o;if(a+r>N(i,s)&&(c=1,l=i+u+1),a+r<1){const r=t.prevMonth;c=N(r.month,r.year),l=i+u-1}return l>12&&(l=1,h=s+o+1),l<1&&(l=12,h=s+o-1),new w(h,l,c)}function v(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function S(t,r=0){return v(t+5*Math.pow(10,r-1),r)}function O(t,r=0){return 0===t?0:v(t-5*Math.pow(10,r-1),r)}function $(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function x(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function z(){return Math.random().toString().substr(2)}function E(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:v,roundUp:S,roundDown:O,roundTowardZero:function(t,r=0){return t<0?S(t,r):O(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:$,fib2:x,fibArray:function(t){return Array(t).fill(0).map((()=>$(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>x(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var M=Object.freeze({__proto__:null,uid:z,uuid:E,suid:function(){return Symbol(z())},suuid:function(){return Symbol(E())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),M.uid(),w.today.nextYear.toDate();const D=t=>new window.FormData(t),j=t=>{const r={};try{D(t).forEach(((t,e)=>{const n=r[e];f.isArray(n)?r[e].push(t):f.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var k=j,P=D;exports.wireForm=function(t,n){if(t&&!t.__ku4wired__)try{var i=t.submit;t.submit=r(regeneratorRuntime.mark((function r(){var s,a,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=k(t),a=P(t),r.next=4,n(s,a,t);case 4:u=r.sent,e.isFalse(u)||i.call(t);case 6:case"end":return r.stop()}}),r)}))),t.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
|
1
|
+
"use strict";function t(t,r,e,n,i,s,a){try{var u=t[s](a),o=u.value}catch(t){return void e(t)}u.done?r(o):Promise.resolve(o).then(n,i)}function r(r){return function(){var e=this,n=arguments;return new Promise((function(i,s){var a=r.apply(e,n);function u(r){t(a,i,s,u,o,"next",r)}function o(r){t(a,i,s,u,o,"throw",r)}u(void 0)}))}}Object.defineProperty(exports,"__esModule",{value:!0});class e{static isNull(t){return null===t}static isEmpty(t){return e.isString(t)&&""===t||e.isArray(t)&&t.length<1||e.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(e.isUndefined(t)||e.isNull(t))}static isNullOrEmpty(t){return!e.exists(t)||e.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return e.isBool(t)&&!0===t}static isFalse(t){return e.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||e.isFunction(t)&&/^async/.test(t.toString())||e.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return e.exists(t)&&"object"==typeof t&&!(e.isBool(t)||e.isNumber(t)||e.isDate(t)||e.isArray(t)||e.isString(t)||e.isFunction(t))}static isObjectLiteral(t){return e.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!e.isFalsy(t)}static isFalsy(t){return e.isZero(t)||e.isFalse(t)||e.isNullOrEmpty(t)||isNaN(t)}}function n(t){return e.exists(t)&&e.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function i(t){return e.exists(t)&&e.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function s(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function a(t,r=0){return s(t+5*Math.pow(10,r-1),r)}function u(t,r=0){return 0===t?0:s(t-5*Math.pow(10,r-1),r)}function o(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function c(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function l(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function h(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,r=0){if(!e.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return n(i(t))},trimStart:n,trimEnd:i,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,n="_"){return e.isFunction(r)?r(t):e.isString(r)&&t.split("").reduce(((t,r)=>t.replace(new RegExp(n),r)),r)},unmask:function(t,r,n="_"){const i=new RegExp(n);return e.isFunction(r)?r(t):e.isString(r)&&t.split("").reduce(((t,e,n)=>!i.test(e)&&i.test(r.charAt(n))?t+e:t),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:s,roundUp:a,roundDown:u,roundTowardZero:function(t,r=0){return t<0?a(t,r):u(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:o,fib2:c,fibArray:function(t){return Array(t).fill(0).map((()=>o(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>c(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:l,uuid:h,suid:function(){return Symbol(l())},suuid:function(){return Symbol(h())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class f{static isNull(t){return null===t}static isEmpty(t){return f.isString(t)&&""===t||f.isArray(t)&&t.length<1||f.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(f.isUndefined(t)||f.isNull(t))}static isNullOrEmpty(t){return!f.exists(t)||f.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return f.isBool(t)&&!0===t}static isFalse(t){return f.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||f.isFunction(t)&&/^async/.test(t.toString())||f.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return f.exists(t)&&"object"==typeof t&&!(f.isBool(t)||f.isNumber(t)||f.isDate(t)||f.isArray(t)||f.isString(t)||f.isFunction(t))}static isObjectLiteral(t){return f.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!f.isFalsy(t)}static isFalsy(t){return f.isZero(t)||f.isFalse(t)||f.isNullOrEmpty(t)||isNaN(t)}}function p(...t){return"".concat(...t)}function d(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function y(t){return m(g(t))}function m(t){return f.exists(t)&&f.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function g(t){return f.exists(t)&&f.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function _(t,r){try{return t()}catch{return r}}let b;Object.freeze({__proto__:null,build:p,chunk:function(t,r=0){if(!f.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:d,trim:y,trimStart:m,trimEnd:g,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){return f.isFunction(r)?r(t):f.isString(r)&&t.split("").reduce(((t,r)=>t.replace(new RegExp(e),r)),r)},unmask:function(t,r,e="_"){const n=new RegExp(e);return f.isFunction(r)?r(t):f.isString(r)&&t.split("").reduce(((t,e,i)=>!n.test(e)&&n.test(r.charAt(i))?t+e:t),"")}}),_.async=async(t,r)=>{try{return await t()}catch{return r}};class w{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>N(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return A(this._year)}get nextDay(){return F(this,1,0,0)}get prevDay(){return F(this,-1,0,0)}get nextMonth(){return F(this,0,1,0)}get prevMonth(){return F(this,0,-1,0)}get nextYear(){return F(this,0,0,1)}get prevYear(){return F(this,0,0,-1)}get firstDayOfMonth(){return new w(this._year,this._month,1)}get lastDayOfMonth(){return new w(this._year,this._month,N(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),u=i(r),o=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),u,c),a,o)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return d(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return f.isString(t)||f.isNumber(t)||f.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof w}static parse(t){if(t instanceof w)return t;let r=f.isString(t)?y(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!f.exists(r)||Number.isNaN(e.valueOf()))throw new Error(d("Cannot parse value= {0}",r));return new w(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return _((()=>w.parse(t)),null)}static assumeNow(t){b=w.parse(t)}static get today(){return b||w.parse(new Date)}}function N(t,r){return 2===t?A(r)?29:28:t<8&&f.isEven(t)||t>7&&f.isOdd(t)?30:31}function A(t){const r=t.toString().split(/\B/);return parseFloat(p(r[r.length-2],r[r.length-1]))%4==0}function F(t,r,e,n){const i=t.month,s=t.year,a=t.date,u=e,o=n;let c=a+r,l=i+u,h=s+o;if(a+r>N(i,s)&&(c=1,l=i+u+1),a+r<1){const r=t.prevMonth;c=N(r.month,r.year),l=i+u-1}return l>12&&(l=1,h=s+o+1),l<1&&(l=12,h=s+o-1),new w(h,l,c)}function v(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function S(t,r=0){return v(t+5*Math.pow(10,r-1),r)}function O(t,r=0){return 0===t?0:v(t-5*Math.pow(10,r-1),r)}function $(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function x(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function z(){return Math.random().toString().substr(2)}function E(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:v,roundUp:S,roundDown:O,roundTowardZero:function(t,r=0){return t<0?S(t,r):O(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:$,fib2:x,fibArray:function(t){return Array(t).fill(0).map((()=>$(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>x(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var M=Object.freeze({__proto__:null,uid:z,uuid:E,suid:function(){return Symbol(z())},suuid:function(){return Symbol(E())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),M.uid(),w.today.nextYear.toDate();const D=t=>new window.FormData(t),j=t=>{const r={};try{D(t).forEach(((t,e)=>{const n=r[e];f.isArray(n)?r[e].push(t):f.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var k=j,P=D;exports.wireForm=function(t,n){if(t&&!t.__ku4wired__)try{var i=t.submit;t.submit=r(regeneratorRuntime.mark((function r(){var s,a,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=k(t),a=P(t),r.next=4,n(s,a,t);case 4:u=r.sent,e.isFalse(u)||i.call(t);case 6:case"end":return r.stop()}}),r)}))),t.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
|
package/react/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
class t{static isNull(t){return null===t}static isEmpty(r){return t.isString(r)&&""===r||t.isArray(r)&&r.length<1||t.isObjectLiteral(r)&&Object.keys(r).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(r){return!(t.isUndefined(r)||t.isNull(r))}static isNullOrEmpty(r){return!t.exists(r)||t.isEmpty(r)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(r){return t.isBool(r)&&!0===r}static isFalse(r){return t.isBool(r)&&!1===r}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(r){try{return"AsyncFunction"===Object.getPrototypeOf(r).constructor.name||t.isFunction(r)&&/^async/.test(r.toString())||t.isFunction(r().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(r){return t.exists(r)&&"object"==typeof r&&!(t.isBool(r)||t.isNumber(r)||t.isDate(r)||t.isArray(r)||t.isString(r)||t.isFunction(r))}static isObjectLiteral(r){return t.isObject(r)&&r.constructor==={}.constructor}static isTruthy(r){return!t.isFalsy(r)}static isFalsy(r){return t.isZero(r)||t.isFalse(r)||t.isNullOrEmpty(r)||isNaN(r)}}function r(r){return t.exists(r)&&t.isFunction(r.replace)?r.replace(/^[\s\n]*/,""):r}function e(r){return t.exists(r)&&t.isFunction(r.replace)?r.replace(/[\s\n]*$/,""):r}function n(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function i(t,r=0){return n(t+5*Math.pow(10,r-1),r)}function s(t,r=0){return 0===t?0:n(t-5*Math.pow(10,r-1),r)}function a(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function u(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function o(){return Math.random().toString().substr(2)}function c(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(r,e=0){if(!t.isString(r)||Number.isNaN(e)||e<0)return[];if(e<r.length){let t=0;const n=e||r.length,i=[];for(;t<r.length;)i.push(r.slice(t,t+n)),t+=n;return i}return[r]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return r(e(t))},trimStart:r,trimEnd:e,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(r,e,n="_"){return t.isFunction(e)?e(r):t.isString(e)&&r.split("").reduce(((t,r)=>t.replace(new RegExp(n),r)),e)},unmask:function(r,e,n="_"){const i=new RegExp(n);return t.isFunction(e)?e(r):t.isString(e)&&r.split("").reduce(((t,r,n)=>!i.test(r)&&i.test(e.charAt(n))?t+r:t),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:n,roundUp:i,roundDown:s,roundTowardZero:function(t,r=0){return t<0?i(t,r):s(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:a,fib2:u,fibArray:function(t){return Array(t).fill(0).map((()=>a(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>u(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:o,uuid:c,suid:function(){return Symbol(o())},suuid:function(){return Symbol(c())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class l{static isNull(t){return null===t}static isEmpty(t){return l.isString(t)&&""===t||l.isArray(t)&&t.length<1||l.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(l.isUndefined(t)||l.isNull(t))}static isNullOrEmpty(t){return!l.exists(t)||l.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return l.isBool(t)&&!0===t}static isFalse(t){return l.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||l.isFunction(t)&&/^async/.test(t.toString())||l.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return l.exists(t)&&"object"==typeof t&&!(l.isBool(t)||l.isNumber(t)||l.isDate(t)||l.isArray(t)||l.isString(t)||l.isFunction(t))}static isObjectLiteral(t){return l.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!l.isFalsy(t)}static isFalsy(t){return l.isZero(t)||l.isFalse(t)||l.isNullOrEmpty(t)||isNaN(t)}}function h(...t){return"".concat(...t)}function f(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function p(t){return y(d(t))}function y(t){return l.exists(t)&&l.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function d(t){return l.exists(t)&&l.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function m(t,r){try{return t()}catch{return r}}let g;Object.freeze({__proto__:null,build:h,chunk:function(t,r=0){if(!l.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:f,trim:p,trimStart:y,trimEnd:d,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){return l.isFunction(r)?r(t):l.isString(r)&&t.split("").reduce(((t,r)=>t.replace(new RegExp(e),r)),r)},unmask:function(t,r,e="_"){const n=new RegExp(e);return l.isFunction(r)?r(t):l.isString(r)&&t.split("").reduce(((t,e,i)=>!n.test(e)&&n.test(r.charAt(i))?t+e:t),"")}}),m.async=async(t,r)=>{try{return await t()}catch{return r}};class _{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>b(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return N(this._year)}get nextDay(){return w(this,1,0,0)}get prevDay(){return w(this,-1,0,0)}get nextMonth(){return w(this,0,1,0)}get prevMonth(){return w(this,0,-1,0)}get nextYear(){return w(this,0,0,1)}get prevYear(){return w(this,0,0,-1)}get firstDayOfMonth(){return new _(this._year,this._month,1)}get lastDayOfMonth(){return new _(this._year,this._month,b(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),u=i(r),o=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),u,c),a,o)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return f(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return l.isString(t)||l.isNumber(t)||l.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof _}static parse(t){if(t instanceof _)return t;let r=l.isString(t)?p(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!l.exists(r)||Number.isNaN(e.valueOf()))throw new Error(f("Cannot parse value= {0}",r));return new _(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return m((()=>_.parse(t)),null)}static assumeNow(t){g=_.parse(t)}static get today(){return g||_.parse(new Date)}}function b(t,r){return 2===t?N(r)?29:28:t<8&&l.isEven(t)||t>7&&l.isOdd(t)?30:31}function N(t){const r=t.toString().split(/\B/);return parseFloat(h(r[r.length-2],r[r.length-1]))%4==0}function w(t,r,e,n){const i=t.month,s=t.year,a=t.date,u=e,o=n;let c=a+r,l=i+u,h=s+o;if(a+r>b(i,s)&&(c=1,l=i+u+1),a+r<1){const r=t.prevMonth;c=b(r.month,r.year),l=i+u-1}return l>12&&(l=1,h=s+o+1),l<1&&(l=12,h=s+o-1),new _(h,l,c)}function A(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function F(t,r=0){return A(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:A(t-5*Math.pow(10,r-1),r)}function $(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function O(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function v(){return Math.random().toString().substr(2)}function z(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:A,roundUp:F,roundDown:S,roundTowardZero:function(t,r=0){return t<0?F(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:$,fib2:O,fibArray:function(t){return Array(t).fill(0).map((()=>$(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var x=Object.freeze({__proto__:null,uid:v,uuid:z,suid:function(){return Symbol(v())},suuid:function(){return Symbol(z())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),x.uid(),_.today.nextYear.toDate();const E=t=>new window.FormData(t),D=t=>{const r={};try{E(t).forEach(((t,e)=>{const n=r[e];l.isArray(n)?r[e].push(t):l.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var M=D,j=E;const k=(r,e)=>{if(r&&!r.__ku4wired__)try{const n=r.submit;r.submit=async()=>{const i=M(r),s=j(r),a=await e(i,s,r);t.isFalse(a)||n.call(r)},r.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{k as wireForm};
|
1
|
+
class t{static isNull(t){return null===t}static isEmpty(r){return t.isString(r)&&""===r||t.isArray(r)&&r.length<1||t.isObjectLiteral(r)&&Object.keys(r).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(r){return!(t.isUndefined(r)||t.isNull(r))}static isNullOrEmpty(r){return!t.exists(r)||t.isEmpty(r)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(r){return t.isBool(r)&&!0===r}static isFalse(r){return t.isBool(r)&&!1===r}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(r){try{return"AsyncFunction"===Object.getPrototypeOf(r).constructor.name||t.isFunction(r)&&/^async/.test(r.toString())||t.isFunction(r().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(r){return t.exists(r)&&"object"==typeof r&&!(t.isBool(r)||t.isNumber(r)||t.isDate(r)||t.isArray(r)||t.isString(r)||t.isFunction(r))}static isObjectLiteral(r){return t.isObject(r)&&r.constructor==={}.constructor}static isTruthy(r){return!t.isFalsy(r)}static isFalsy(r){return t.isZero(r)||t.isFalse(r)||t.isNullOrEmpty(r)||isNaN(r)}}function r(r){return t.exists(r)&&t.isFunction(r.replace)?r.replace(/^[\s\n]*/,""):r}function e(r){return t.exists(r)&&t.isFunction(r.replace)?r.replace(/[\s\n]*$/,""):r}function n(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function i(t,r=0){return n(t+5*Math.pow(10,r-1),r)}function s(t,r=0){return 0===t?0:n(t-5*Math.pow(10,r-1),r)}function a(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function u(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function o(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function c(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(r,e=0){if(!t.isString(r)||Number.isNaN(e)||e<0)return[];if(e<r.length){let t=0;const n=e||r.length,i=[];for(;t<r.length;)i.push(r.slice(t,t+n)),t+=n;return i}return[r]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return r(e(t))},trimStart:r,trimEnd:e,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(r,e,n="_"){return t.isFunction(e)?e(r):t.isString(e)&&r.split("").reduce(((t,r)=>t.replace(new RegExp(n),r)),e)},unmask:function(r,e,n="_"){const i=new RegExp(n);return t.isFunction(e)?e(r):t.isString(e)&&r.split("").reduce(((t,r,n)=>!i.test(r)&&i.test(e.charAt(n))?t+r:t),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:n,roundUp:i,roundDown:s,roundTowardZero:function(t,r=0){return t<0?i(t,r):s(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:a,fib2:u,fibArray:function(t){return Array(t).fill(0).map((()=>a(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>u(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:o,uuid:c,suid:function(){return Symbol(o())},suuid:function(){return Symbol(c())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class l{static isNull(t){return null===t}static isEmpty(t){return l.isString(t)&&""===t||l.isArray(t)&&t.length<1||l.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(l.isUndefined(t)||l.isNull(t))}static isNullOrEmpty(t){return!l.exists(t)||l.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return l.isBool(t)&&!0===t}static isFalse(t){return l.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||l.isFunction(t)&&/^async/.test(t.toString())||l.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return l.exists(t)&&"object"==typeof t&&!(l.isBool(t)||l.isNumber(t)||l.isDate(t)||l.isArray(t)||l.isString(t)||l.isFunction(t))}static isObjectLiteral(t){return l.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!l.isFalsy(t)}static isFalsy(t){return l.isZero(t)||l.isFalse(t)||l.isNullOrEmpty(t)||isNaN(t)}}function h(...t){return"".concat(...t)}function f(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function p(t){return d(y(t))}function d(t){return l.exists(t)&&l.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function y(t){return l.exists(t)&&l.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function m(t,r){try{return t()}catch{return r}}let g;Object.freeze({__proto__:null,build:h,chunk:function(t,r=0){if(!l.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:f,trim:p,trimStart:d,trimEnd:y,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){return l.isFunction(r)?r(t):l.isString(r)&&t.split("").reduce(((t,r)=>t.replace(new RegExp(e),r)),r)},unmask:function(t,r,e="_"){const n=new RegExp(e);return l.isFunction(r)?r(t):l.isString(r)&&t.split("").reduce(((t,e,i)=>!n.test(e)&&n.test(r.charAt(i))?t+e:t),"")}}),m.async=async(t,r)=>{try{return await t()}catch{return r}};class b{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>_(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return N(this._year)}get nextDay(){return w(this,1,0,0)}get prevDay(){return w(this,-1,0,0)}get nextMonth(){return w(this,0,1,0)}get prevMonth(){return w(this,0,-1,0)}get nextYear(){return w(this,0,0,1)}get prevYear(){return w(this,0,0,-1)}get firstDayOfMonth(){return new b(this._year,this._month,1)}get lastDayOfMonth(){return new b(this._year,this._month,_(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),u=i(r),o=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),u,c),a,o)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return f(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return l.isString(t)||l.isNumber(t)||l.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof b}static parse(t){if(t instanceof b)return t;let r=l.isString(t)?p(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!l.exists(r)||Number.isNaN(e.valueOf()))throw new Error(f("Cannot parse value= {0}",r));return new b(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return m((()=>b.parse(t)),null)}static assumeNow(t){g=b.parse(t)}static get today(){return g||b.parse(new Date)}}function _(t,r){return 2===t?N(r)?29:28:t<8&&l.isEven(t)||t>7&&l.isOdd(t)?30:31}function N(t){const r=t.toString().split(/\B/);return parseFloat(h(r[r.length-2],r[r.length-1]))%4==0}function w(t,r,e,n){const i=t.month,s=t.year,a=t.date,u=e,o=n;let c=a+r,l=i+u,h=s+o;if(a+r>_(i,s)&&(c=1,l=i+u+1),a+r<1){const r=t.prevMonth;c=_(r.month,r.year),l=i+u-1}return l>12&&(l=1,h=s+o+1),l<1&&(l=12,h=s+o-1),new b(h,l,c)}function A(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function F(t,r=0){return A(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:A(t-5*Math.pow(10,r-1),r)}function $(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function O(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function v(){return Math.random().toString().substr(2)}function z(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:A,roundUp:F,roundDown:S,roundTowardZero:function(t,r=0){return t<0?F(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:$,fib2:O,fibArray:function(t){return Array(t).fill(0).map((()=>$(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var x=Object.freeze({__proto__:null,uid:v,uuid:z,suid:function(){return Symbol(v())},suuid:function(){return Symbol(z())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/#:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?#]+=[^=?#]*(&[^=?#]+=[^=?#]*)*(#.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),x.uid(),b.today.nextYear.toDate();const E=t=>new window.FormData(t),M=t=>{const r={};try{E(t).forEach(((t,e)=>{const n=r[e];l.isArray(n)?r[e].push(t):l.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var D=M,j=E;const k=(r,e)=>{if(r&&!r.__ku4wired__)try{const n=r.submit;r.submit=async()=>{const i=D(r),s=j(r),a=await e(i,s,r);t.isFalse(a)||n.call(r)},r.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{k as wireForm};
|