payload 0.12.13-beta.0 → 0.13.3
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/CHANGELOG.md +29 -33
- package/components/forms.ts +2 -1
- package/components/index.js +1 -1
- package/dist/admin/components/elements/SearchFilter/index.js +6 -3
- package/dist/admin/components/elements/WhereBuilder/Condition/Relationship/types.d.ts +1 -1
- package/dist/admin/components/forms/DraggableSection/SectionTitle/index.js +2 -2
- package/dist/admin/components/forms/field-types/Array/Array.js +2 -2
- package/dist/admin/components/forms/field-types/Blocks/Blocks.js +2 -2
- package/dist/admin/components/forms/field-types/Checkbox/index.js +2 -2
- package/dist/admin/components/forms/field-types/Code/Code.js +2 -2
- package/dist/admin/components/forms/field-types/ConfirmPassword/index.js +2 -2
- package/dist/admin/components/forms/field-types/DateTime/index.js +2 -2
- package/dist/admin/components/forms/field-types/Email/index.js +2 -2
- package/dist/admin/components/forms/field-types/HiddenInput/index.js +2 -2
- package/dist/admin/components/forms/field-types/Number/index.js +2 -2
- package/dist/admin/components/forms/field-types/Password/index.js +2 -2
- package/dist/admin/components/forms/field-types/Point/index.js +2 -2
- package/dist/admin/components/forms/field-types/RadioGroup/index.js +2 -2
- package/dist/admin/components/forms/field-types/Relationship/index.js +2 -2
- package/dist/admin/components/forms/field-types/Relationship/types.d.ts +1 -1
- package/dist/admin/components/forms/field-types/RichText/RichText.js +2 -2
- package/dist/admin/components/forms/field-types/Select/index.js +32 -16
- package/dist/admin/components/forms/field-types/Text/index.js +19 -6
- package/dist/admin/components/forms/field-types/Textarea/index.js +2 -2
- package/dist/admin/components/forms/field-types/Upload/index.js +21 -8
- package/dist/admin/components/forms/useField/index.d.ts +3 -0
- package/dist/admin/components/forms/{useFieldType → useField}/index.js +30 -9
- package/dist/admin/components/forms/{useFieldType → useField}/types.d.ts +0 -0
- package/dist/admin/components/forms/{useFieldType → useField}/types.js +0 -0
- package/dist/admin/components/views/collections/Edit/Auth/APIKey.js +2 -2
- package/dist/admin/components/views/collections/Edit/Upload/index.js +2 -2
- package/dist/admin/components/views/collections/List/types.d.ts +1 -1
- package/dist/bin/generateTypes.js +5 -1
- package/dist/collections/config/types.d.ts +102 -39
- package/dist/collections/operations/create.d.ts +1 -0
- package/dist/collections/operations/create.js +12 -4
- package/dist/collections/operations/delete.js +6 -5
- package/dist/collections/operations/find.d.ts +2 -2
- package/dist/collections/operations/find.js +13 -11
- package/dist/collections/operations/findByID.d.ts +2 -3
- package/dist/collections/operations/findByID.js +1 -1
- package/dist/collections/operations/local/create.d.ts +1 -0
- package/dist/collections/operations/local/create.js +3 -2
- package/dist/collections/operations/local/delete.d.ts +2 -1
- package/dist/collections/operations/local/delete.js +1 -1
- package/dist/collections/operations/local/find.d.ts +2 -2
- package/dist/collections/operations/local/find.js +1 -1
- package/dist/collections/operations/local/findByID.d.ts +2 -1
- package/dist/collections/operations/local/findByID.js +1 -1
- package/dist/collections/operations/local/update.d.ts +2 -1
- package/dist/collections/operations/local/update.js +1 -1
- package/dist/collections/operations/update.js +11 -3
- package/dist/collections/requestHandlers/find.d.ts +2 -2
- package/dist/collections/requestHandlers/find.js +1 -1
- package/dist/config/types.d.ts +3 -0
- package/dist/fields/baseFields/getBaseUploadFields.js +2 -1
- package/dist/fields/config/types.d.ts +20 -15
- package/dist/fields/config/types.js +1 -1
- package/dist/fields/validations.d.ts +17 -17
- package/dist/graphql/errorHandler.d.ts +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.js +1 -1
- package/dist/mongoose/buildQuery.js +6 -2
- package/dist/uploads/docWithFilenameExists.d.ts +3 -0
- package/dist/uploads/docWithFilenameExists.js +10 -0
- package/dist/uploads/fileExists.d.ts +2 -2
- package/dist/uploads/fileExists.js +4 -3
- package/dist/uploads/getSafeFilename.d.ts +2 -1
- package/dist/uploads/getSafeFilename.js +4 -3
- package/dist/uploads/imageResizer.d.ts +11 -1
- package/dist/uploads/imageResizer.js +2 -2
- package/dist/utilities/sanitizeInternalFields.d.ts +2 -1
- package/dist/utilities/sanitizeInternalFields.js +1 -1
- package/docs/admin/components.mdx +3 -3
- package/docs/fields/blocks.mdx +9 -0
- package/docs/fields/overview.mdx +12 -0
- package/docs/fields/rich-text.mdx +11 -0
- package/docs/hooks/collections.mdx +23 -0
- package/docs/hooks/fields.mdx +28 -0
- package/docs/hooks/globals.mdx +17 -0
- package/docs/typescript/generating-types.mdx +114 -0
- package/docs/typescript/overview.mdx +36 -0
- package/package.json +2 -2
- package/types.d.ts +18 -2
- package/dist/admin/components/forms/useFieldType/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,61 +1,57 @@
|
|
|
1
|
-
## [0.
|
|
1
|
+
## [0.13.3](https://github.com/payloadcms/payload/compare/v0.13.2...v0.13.3) (2021-11-29)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
* upgrade sharp for prebuilt M1 binaries ([34f416a](https://github.com/payloadcms/payload/commit/34f416aace112013359351e17c4371c30303156f))
|
|
7
|
+
|
|
8
|
+
## [0.13.2](https://github.com/payloadcms/payload/compare/v0.13.1...v0.13.2) (2021-11-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* [#373](https://github.com/payloadcms/payload/issues/373) ([727fbec](https://github.com/payloadcms/payload/commit/727fbeceb4b93936ca08d0ca48ac0d2beb1ce96e))
|
|
14
|
+
|
|
15
|
+
## [0.13.1](https://github.com/payloadcms/payload/compare/v0.13.0...v0.13.1) (2021-11-29)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* ensures sorting by _id instead of improper id ([ded891e](https://github.com/payloadcms/payload/commit/ded891e390a93f71963762c0200c97a0beec5cad))
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
### Features
|
|
20
24
|
|
|
21
|
-
*
|
|
22
|
-
* adds field types to type generation ([6dd1b0e](https://github.com/payloadcms/payload/commit/6dd1b0e0339490bf9e500f03f47ed59381644d85))
|
|
23
|
-
* adds relationship filter field ([463c4e6](https://github.com/payloadcms/payload/commit/463c4e60de8e647fca6268b826d826f9c6e45412))
|
|
24
|
-
* applies upload access control to all auto-generated image sizes ([051b7d4](https://github.com/payloadcms/payload/commit/051b7d45befc331af3f73a669b2bb6467505902f))
|
|
25
|
-
* azure cosmos compatibility ([6fd5ac2](https://github.com/payloadcms/payload/commit/6fd5ac2c082a5a5e6f510d781b2a2e12b7b62cb9))
|
|
26
|
-
* baseline type generation ([5a965d2](https://github.com/payloadcms/payload/commit/5a965d2263d1b246149c5220d039a6d97953d5e8))
|
|
27
|
-
* ensures update hooks have access to full original docs even in spite of access control ([b2c5b7e](https://github.com/payloadcms/payload/commit/b2c5b7e5752e829c7a53c054decceb43ec33065e))
|
|
28
|
-
* finishes typing all fields ([ed5a5eb](https://github.com/payloadcms/payload/commit/ed5a5ebe7e16d20577556ab233032a52bef6d2cb))
|
|
29
|
-
* generates further field types ([2ca76ba](https://github.com/payloadcms/payload/commit/2ca76ba8ce6c61ee7b0a01a557b6f013ca483d6d))
|
|
30
|
-
* improves querying logic ([4c85747](https://github.com/payloadcms/payload/commit/4c8574784995b1cb1f939648f4d2158286089b3d))
|
|
31
|
-
* indexes filenames ([5d43262](https://github.com/payloadcms/payload/commit/5d43262f42e0529a44572f398aa1ec5fd7858286))
|
|
32
|
-
* migrates admin preview to async ([40ca3da](https://github.com/payloadcms/payload/commit/40ca3dae61f8ddf05363b6cad426deba4cde1e30))
|
|
25
|
+
* only adds list search query param if value is present ([d6d76d4](https://github.com/payloadcms/payload/commit/d6d76d4088a23ed43122333873ada6846c808d37))
|
|
33
26
|
|
|
34
|
-
|
|
27
|
+
# [0.13.0](https://github.com/payloadcms/payload/compare/v0.12.3...v0.13.0) (2021-11-26)
|
|
35
28
|
|
|
36
29
|
|
|
37
30
|
### Bug Fixes
|
|
38
31
|
|
|
39
32
|
* [#351](https://github.com/payloadcms/payload/issues/351) ([94c2b8d](https://github.com/payloadcms/payload/commit/94c2b8d80b046c067057d4ad089ed6a2edd656cf))
|
|
33
|
+
* [#358](https://github.com/payloadcms/payload/issues/358) - reuploading with existing filenames ([a0fb48c](https://github.com/payloadcms/payload/commit/a0fb48c9a37beceafc6f0638604e9946d0814635))
|
|
34
|
+
* allows sync or async preview urls ([da6e1df](https://github.com/payloadcms/payload/commit/da6e1df293ce46bc4d0c84645db61feea2881aa7))
|
|
40
35
|
* bug with relationship cell when no doc is available ([40b33d9](https://github.com/payloadcms/payload/commit/40b33d9f5e99285cb0de148dbe059259817fcad8))
|
|
41
|
-
|
|
42
|
-
* ensures buildQuery works with fields as well as simultaneous or / and ([72fc413](https://github.com/payloadcms/payload/commit/72fc413764c6c42ba64a45f01d99b68ad3bd46c4))
|
|
43
|
-
* ensures relationship field search can return more than 10 options ([57c0346](https://github.com/payloadcms/payload/commit/57c0346a00286a3df695ea46e5c2630494183b5b))
|
|
36
|
+
3839ef75151f))
|
|
44
37
|
* ensures richtext links retain proper formatting ([abf61d0](https://github.com/payloadcms/payload/commit/abf61d0734c09fd0fc5c5b827cb0631e11701f71))
|
|
45
|
-
* ensures querying by relationship subpaths works ([37b21b0](https://github.com/payloadcms/payload/commit/37b21b07628e892e85c2cf979d9e2c8af0d291f7))
|
|
46
|
-
*
|
|
38
|
+
* ensures that querying by relationship subpaths works ([37b21b0](https://github.com/payloadcms/payload/commit/37b21b07628e892e85c2cf979d9e2c8af0d291f7))
|
|
39
|
+
* ensures uploads can be fetched with CORS ([96421b3](https://github.com/payloadcms/payload/commit/96421b3d59a87f8a3d781005c02344fe5d3a607f))
|
|
40
|
+
* typing for collection description ([bb18e82](https://github.com/payloadcms/payload/commit/bb18e8250c5742d9615e5780c1cd02d33ecca3d0))
|
|
47
41
|
* updates field description type to include react nodes ([291c193](https://github.com/payloadcms/payload/commit/291c193ad4a9ec8ce9310cc63c714eba10eca102))
|
|
48
42
|
|
|
49
|
-
|
|
50
43
|
### Features
|
|
51
44
|
|
|
52
|
-
* :tada: builds a way to automatically generate types for collections and globals
|
|
45
|
+
* :tada: :tada: builds a way to automatically generate types for collections and globals!.
|
|
46
|
+
* :tada: dramatically improves Payload types like local API methods and hooks to function as `generic`s
|
|
53
47
|
* adds relationship filter field ([463c4e6](https://github.com/payloadcms/payload/commit/463c4e60de8e647fca6268b826d826f9c6e45412))
|
|
48
|
+
* applies upload access control to all auto-generated image sizes ([051b7d4](https://github.com/payloadcms/payload/commit/051b7d45befc331af3f73a669b2bb6467505902f))
|
|
54
49
|
* azure cosmos compatibility ([6fd5ac2](https://github.com/payloadcms/payload/commit/6fd5ac2c082a5a5e6f510d781b2a2e12b7b62cb9))
|
|
55
50
|
* ensures update hooks have access to full original docs even in spite of access control ([b2c5b7e](https://github.com/payloadcms/payload/commit/b2c5b7e5752e829c7a53c054decceb43ec33065e))
|
|
56
51
|
* improves querying logic ([4c85747](https://github.com/payloadcms/payload/commit/4c8574784995b1cb1f939648f4d2158286089b3d))
|
|
57
52
|
* indexes filenames ([5d43262](https://github.com/payloadcms/payload/commit/5d43262f42e0529a44572f398aa1ec5fd7858286))
|
|
58
|
-
*
|
|
53
|
+
* renames useFieldType to useField ([0245747](https://github.com/payloadcms/payload/commit/0245747020c7c039b15d055f54a4548a364d047e))
|
|
54
|
+
* supports custom onChange handling in text, select, and upload fields ([4affdc3](https://github.com/payloadcms/payload/commit/4affdc3a9397d70f5baacdd12753c8fc8c7d8368))
|
|
59
55
|
|
|
60
56
|
## [0.12.3](https://github.com/payloadcms/payload/compare/v0.12.2...v0.12.3) (2021-10-23)
|
|
61
57
|
|
package/components/forms.ts
CHANGED
|
@@ -6,7 +6,8 @@ export {
|
|
|
6
6
|
useFormModified,
|
|
7
7
|
} from '../dist/admin/components/forms/Form/context';
|
|
8
8
|
|
|
9
|
-
export { default as
|
|
9
|
+
export { default as useField } from '../dist/admin/components/forms/useField';
|
|
10
|
+
export { default as useFieldType } from '../dist/admin/components/forms/useField';
|
|
10
11
|
|
|
11
12
|
export { default as Form } from '../dist/admin/components/forms/Form';
|
|
12
13
|
|
package/components/index.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,v=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,g=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case f:case i:case c:case a:case p:return e;default:switch(e=e&&e.$$typeof){case s:case d:case m:case v:case u:return e;default:return t}}case o:return t}}}function _(e){return x(e)===f}t.AsyncMode=l,t.ConcurrentMode=f,t.ContextConsumer=s,t.ContextProvider=u,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=v,t.Portal=o,t.Profiler=c,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return _(e)||x(e)===l},t.isConcurrentMode=_,t.isContextConsumer=function(e){return x(e)===s},t.isContextProvider=function(e){return x(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===d},t.isFragment=function(e){return x(e)===i},t.isLazy=function(e){return x(e)===m},t.isMemo=function(e){return x(e)===v},t.isPortal=function(e){return x(e)===o},t.isProfiler=function(e){return x(e)===c},t.isStrictMode=function(e){return x(e)===a},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===c||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===v||e.$$typeof===u||e.$$typeof===s||e.$$typeof===d||e.$$typeof===g||e.$$typeof===w||e.$$typeof===b||e.$$typeof===y)},t.typeOf=x},864:(e,t,n)=>{"use strict";e.exports=n(921)},658:(e,t,n)=>{var r=n(826);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return c(i(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=d;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,c="",l=t&&t.delimiter||"/";null!=(n=o.exec(e));){var f=n[0],d=n[1],p=n.index;if(c+=e.slice(a,p),a=p+f.length,d)c+=d[1];else{var h=e[a],v=n[2],m=n[3],y=n[4],g=n[5],w=n[6],b=n[7];c&&(r.push(c),c="");var x=null!=v&&null!=h&&h!==v,_="+"===w||"*"===w,O="?"===w||"*"===w,E=n[2]||l,P=y||g;r.push({name:m||i++,prefix:v||"",delimiter:E,optional:O,repeat:_,partial:x,asterisk:!!b,pattern:P?s(P):b?".*":"[^"+u(E)+"]+?"})}}return a<e.length&&(c+=e.substr(a)),c&&r.push(c),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function c(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",f(t)));return function(t,o){for(var i="",c=t||{},u=(o||{}).pretty?a:encodeURIComponent,s=0;s<e.length;s++){var l=e[s];if("string"!=typeof l){var f,d=c[l.name];if(null==d){if(l.optional){l.partial&&(i+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(r(d)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(0===d.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var p=0;p<d.length;p++){if(f=u(d[p]),!n[s].test(f))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(f)+"`");i+=(0===p?l.prefix:l.delimiter)+f}}else{if(f=l.asterisk?encodeURI(d).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):u(d),!n[s].test(f))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+f+'"');i+=l.prefix+f}}else i+=l}return i}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function s(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function f(e){return e&&e.sensitive?"":"i"}function d(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",c=0;c<e.length;c++){var s=e[c];if("string"==typeof s)a+=u(s);else{var d=u(s.prefix),p="(?:"+s.pattern+")";t.push(s),s.repeat&&(p+="(?:"+d+p+")*"),a+=p=s.optional?s.partial?d+"("+p+")?":"(?:"+d+"("+p+"))?":d+"("+p+")"}}var h=u(n.delimiter||"/"),v=a.slice(-h.length)===h;return o||(a=(v?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=i?"$":o&&v?"":"(?="+h+"|$)",l(new RegExp("^"+a,f(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return l(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(p(e[o],t,n).source);return l(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(e,t,n):function(e,t,n){return d(i(e,n),t,n)}(e,t,n)}},497:e=>{"use strict";e.exports=require("react")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Banner:()=>Oe,Button:()=>he,Check:()=>Se,Chevron:()=>le,Menu:()=>Ce,MinimalTemplate:()=>Pe,Pill:()=>Te,Popup:()=>xe,Search:()=>je,X:()=>se});var e=n(497),t=n.n(e);function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}var a=n(697),c=n.n(a);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function s(e){return"/"===e.charAt(0)}function l(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}const f=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&s(e),a=t&&s(t),c=i||a;if(e&&s(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var u=o[o.length-1];n="."===u||".."===u||""===u}else n=!1;for(var f=0,d=o.length;d>=0;d--){var p=o[d];"."===p?l(o,d):".."===p?(l(o,d),f++):f&&(l(o,d),f--)}if(!c)for(;f--;f)o.unshift("..");!c||""===o[0]||o[0]&&s(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};var d="Invariant failed";const p=function(e,t){if(!e)throw new Error(d)};function h(e){return"/"===e.charAt(0)?e:"/"+e}function v(e){return"/"===e.charAt(0)?e.substr(1):e}function m(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function y(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function g(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function w(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=u({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=f(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function b(){var e=null;var t=[];return{setPrompt:function(t){return t,function(){e===t&&null}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){!1,t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var x=!("undefined"==typeof window||!window.document||!window.document.createElement);function _(e,t){t(window.confirm(e))}var O="popstate",E="hashchange";function P(){try{return window.history.state||{}}catch(e){return{}}}function S(e){void 0===e&&{},x||p(!1);var t,n=window.history,r=(-1===window.navigator.userAgent.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,a=i.forceRefresh,c=void 0!==a&&a,s=i.getUserConfirmation,l=void 0===s?_:s,f=i.keyLength,d=void 0===f?6:f,v=e.basename?y(h(e.basename)):"";function S(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return v&&m(i,v),w(i,r,n)}function j(){return Math.random().toString(36).substr(2,d)}var C=b();function k(e){u(F,e),F.length=n.length,C.notifyListeners(F.location,F.action)}function T(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||I(S(e.state))}function M(){I(S(P()))}var A=!1;function I(e){if(A)!1,k();else{C.confirmTransitionTo(e,"POP",l,(function(t){t?k({action:"POP",location:e}):function(e){var t=F.location,n=L.indexOf(t.key);-1===n&&0;var r=L.indexOf(e.key);-1===r&&0;var o=n-r;o&&(!0,D(o))}(e)}))}}var N=S(P()),L=[N.key];function R(e){return v+g(e)}function D(e){n.go(e)}var $=0;function W(e){1===($+=e)&&1===e?(window.addEventListener(O,T),o&&window.addEventListener(E,M)):0===$&&(window.removeEventListener(O,T),o&&window.removeEventListener(E,M))}var B=!1;var F={length:n.length,action:"POP",location:N,createHref:R,push:function(e,t){var o="PUSH",i=w(e,t,j(),F.location);C.confirmTransitionTo(i,o,l,(function(e){if(e){var t=R(i),a=i.key,u=i.state;if(r)if(n.pushState({key:a,state:u},null,t),c)window.location.href=t;else{var s=L.indexOf(F.location.key),l=L.slice(0,s+1);l.push(i.key),l,k({action:o,location:i})}else window.location.href=t}}))},replace:function(e,t){var o="REPLACE",i=w(e,t,j(),F.location);C.confirmTransitionTo(i,o,l,(function(e){if(e){var t=R(i),a=i.key,u=i.state;if(r)if(n.replaceState({key:a,state:u},null,t),c)window.location.replace(t);else{var s=L.indexOf(F.location.key);-1!==s&&(L[s]=i.key),k({action:o,location:i})}else window.location.replace(t)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&!1;var t=C.setPrompt(e);return B||(W(1),!0),function(){return B&&(!1,W(-1)),t()}},listen:function(e){var t=C.appendListener(e);return W(1),function(){W(-1),t()}}};return F}var j="hashchange",C={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+v(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:v,decodePath:h},slash:{encodePath:h,decodePath:h}};function k(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function T(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function M(e){window.location.replace(k(window.location.href)+"#"+e)}function A(e){void 0===e&&{},x||p(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,o=void 0===r?_:r,i=n.hashType,a=void 0===i?"slash":i,c=e.basename?y(h(e.basename)):"",s=C[a],l=s.encodePath,f=s.decodePath;function d(){var e=f(T());return c&&m(e,c),w(e)}var v=b();function O(e){u(B,e),B.length=t.length,v.notifyListeners(B.location,B.action)}var E=!1,P=null;function S(){var e,t,n=T(),r=l(n);if(n!==r)M(r);else{var i=d(),a=B.location;if(!E&&(i,a.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(P===g(i))return;null,function(e){if(E)!1,O();else{var t="POP";v.confirmTransitionTo(e,t,o,(function(n){n?O({action:t,location:e}):function(e){var t=B.location,n=L.lastIndexOf(g(t));-1===n&&0;var r=L.lastIndexOf(g(e));-1===r&&0;var o=n-r;o&&(!0,R(o))}(e)}))}}(i)}}var A=T(),I=l(A);A!==I&&M(I);var N=d(),L=[g(N)];function R(e){t.go(e)}var D=0;function $(e){1===(D+=e)&&1===e?window.addEventListener(j,S):0===D&&window.removeEventListener(j,S)}var W=!1;var B={length:t.length,action:"POP",location:N,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&k(window.location.href),n+"#"+l(c+g(e))},push:function(e,t){var n="PUSH",r=w(e,void 0,void 0,B.location);v.confirmTransitionTo(r,n,o,(function(e){if(e){var t=g(r),o=l(c+t);if(T()!==o){t,function(e){window.location.hash=e}(o);var i=L.lastIndexOf(g(B.location)),a=L.slice(0,i+1);a.push(t),a,O({action:n,location:r})}else O()}}))},replace:function(e,t){var n="REPLACE",r=w(e,void 0,void 0,B.location);v.confirmTransitionTo(r,n,o,(function(e){if(e){var t=g(r),o=l(c+t);T()!==o&&(t,M(o));var i=L.indexOf(g(B.location));-1!==i&&(L[i]=t),O({action:n,location:r})}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&!1;var t=v.setPrompt(e);return W||($(1),!0),function(){return W&&(!1,$(-1)),t()}},listen:function(e){var t=v.appendListener(e);return $(1),function(){$(-1),t()}}};return B}function I(e,t,n){return Math.min(Math.max(e,t),n)}function N(e){void 0===e&&{};var t=e,n=t.getUserConfirmation,r=t.initialEntries,o=void 0===r?["/"]:r,i=t.initialIndex,a=void 0===i?0:i,c=t.keyLength,s=void 0===c?6:c,l=b();function f(e){u(y,e),y.length=y.entries.length,l.notifyListeners(y.location,y.action)}function d(){return Math.random().toString(36).substr(2,s)}var p=I(a,0,o.length-1),h=o.map((function(e){return w(e,void 0,"string"==typeof e?d():e.key||d())})),v=g;function m(e){var t=I(y.index+e,0,y.entries.length-1),r=y.entries[t];l.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var y={length:h.length,action:"POP",location:h[p],index:p,entries:h,createHref:v,push:function(e,t){var r="PUSH",o=w(e,t,d(),y.location);l.confirmTransitionTo(o,r,n,(function(e){if(e){var t=y.index+1,n=y.entries.slice(0);n.length>t?n.splice(t,n.length-t,o):n.push(o),f({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=w(e,t,d(),y.location);l.confirmTransitionTo(o,r,n,(function(e){e&&(y.entries[y.index]=o,f({action:r,location:o}))}))},go:m,goBack:function(){m(-1)},goForward:function(){m(1)},canGo:function(e){var t=y.index+e;return t>=0&&t<y.entries.length},block:function(e){return void 0===e&&!1,l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return y}var L=1073741823,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function D(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var $=t().createContext||function(t,n){var r,o,a="__create-react-context-"+function(){var e="__global_unique_id__";return R[e]=(R[e]||0)+1}()+"__",u=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).emitter=D(t.props.value),t}i(t,e);var r=t.prototype;return r.getChildContext=function(){var e;return(e={})[a]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?t=0:(t="function"==typeof n?n(r,o):L,0!==(t|=0)&&this.emitter.set(e.value,t))}var i,a},r.render=function(){return this.props.children},t}(e.Component);u.childContextTypes=((r={})[a]=c().object.isRequired,r);var s=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,n){0!=((0|t.observedBits)&n)&&t.setState({value:t.getValue()})},t}i(n,e);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?L:t},r.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?L:e},r.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},r.getValue=function(){return this.context[a]?this.context[a].get():t},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(e.Component);return s.contextTypes=((o={})[a]=c().object,o),{Provider:u,Consumer:s}};const W=$;var B=n(658),F=n.n(B);n(864);function U(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n(679);var q=function(e){var t=W();return t.displayName=e,t},H=q("Router-History"),z=q("Router"),V=function(e){function n(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}i(n,e),n.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var r=n.prototype;return r.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},r.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},r.render=function(){return t().createElement(z.Provider,{value:{history:this.props.history,location:this.state.location,match:n.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},t().createElement(H.Provider,{children:this.props.children||null,value:this.props.history}))},n}(t().Component);t().Component;t().Component;var K={},J=0;function X(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,c=void 0!==a&&a,u=n.sensitive,s=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=K[n]||(K[n]={});if(r[e])return r[e];var o=[],i={regexp:F()(e,o,t),keys:o};return J<1e4&&(r[e]=i,J++),i}(n,{end:i,strict:c,sensitive:s}),o=r.regexp,a=r.keys,u=o.exec(e);if(!u)return null;var l=u[0],f=u.slice(1),d=e===l;return i&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}t().Component;function Y(e){return"/"===e.charAt(0)?e:"/"+e}function G(e,t){if(!e)return t;var n=Y(e);return 0!==t.pathname.indexOf(n)?t:u({},t,{pathname:t.pathname.substr(n.length)})}function Q(e){return"string"==typeof e?e:g(e)}function Z(e){return function(){p(!1)}}function ee(){}t().Component;t().Component;t().useContext;t().Component;t().Component;var te=function(e,t){return"function"==typeof e?e(t):e},ne=function(e,t){return"string"==typeof e?w(e,null,null,t):e},re=function(e){return e},oe=t().forwardRef;void 0===oe&&(oe=re);var ie=oe((function(e,n){var r=e.innerRef,o=e.navigate,i=e.onClick,a=U(e,["innerRef","navigate","onClick"]),c=a.target,s=u({},a,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||c&&"_self"!==c||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),o())}});return s.ref=re!==oe&&n||r,t().createElement("a",s)}));var ae=oe((function(e,n){var r=e.component,o=void 0===r?ie:r,i=e.replace,a=e.to,c=e.innerRef,s=U(e,["component","replace","to","innerRef"]);return t().createElement(z.Consumer,null,(function(e){e||p(!1);var r=e.history,l=ne(te(a,e.location),e.location),f=l?r.createHref(l):"",d=u({},s,{href:f,navigate:function(){var t=te(a,e.location),n=g(e.location)===g(ne(t));(i||n?r.replace:r.push)(t)}});return re!==oe?d.ref=n||c:d.innerRef=c,t().createElement(o,d)}))})),ce=function(e){return e},ue=t().forwardRef;void 0===ue&&(ue=ce);ue((function(e,n){var r=e["aria-current"],o=void 0===r?"page":r,i=e.activeClassName,a=void 0===i?"active":i,c=e.activeStyle,s=e.className,l=e.exact,f=e.isActive,d=e.location,h=e.sensitive,v=e.strict,m=e.style,y=e.to,g=e.innerRef,w=U(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return t().createElement(z.Consumer,null,(function(e){e||p(!1);var r=d||e.location,i=ne(te(y,r),r),b=i.pathname,x=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),_=x?X(r.pathname,{path:x,exact:l,sensitive:h,strict:v}):null,O=!!(f?f(_,r):_),E="function"==typeof s?s(O):s,P="function"==typeof m?m(O):m;O&&(E=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(E,a),P=u({},P,c));var S=u({"aria-current":O&&o||null,className:E,style:P,to:i},w);return ce!==ue?S.ref=n||g:S.innerRef=g,t().createElement(ae,S)}))}));const se=()=>t().createElement("svg",{width:"25",height:"25",className:"icon icon--x",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("line",{className:"stroke",x1:"8.74612",y1:"16.347",x2:"16.3973",y2:"8.69584"}),t().createElement("line",{className:"stroke",x1:"8.6027",y1:"8.69585",x2:"16.2539",y2:"16.3471"})),le=({className:e})=>t().createElement("svg",{className:["icon icon--chevron",e].filter(Boolean).join(" "),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("path",{className:"stroke",d:"M9 10.5L12.5 14.5L16 10.5"})),fe={plus:()=>t().createElement("svg",{className:"icon icon--plus",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("line",{x1:"12.4589",y1:"16.9175",x2:"12.4589",y2:"8.50115",className:"stroke"}),t().createElement("line",{x1:"8.05164",y1:"12.594",x2:"16.468",y2:"12.594",className:"stroke"})),x:se,chevron:le,edit:()=>t().createElement("svg",{className:"icon icon--edit",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("polygon",{className:"fill",points:"16.92 16.86 8.25 16.86 8.25 8.21 12.54 8.21 12.54 6.63 6.68 6.63 6.68 18.43 18.5 18.43 18.5 12.53 16.92 12.53 16.92 16.86"}),t().createElement("polygon",{className:"fill",points:"16.31 7.33 17.42 8.44 12.66 13.2 11.51 13.24 11.55 12.09 16.31 7.33"}),t().createElement("rect",{className:"fill",x:"16.94",y:"6.44",width:"1.58",height:"1.15",transform:"translate(10.16 -10.48) rotate(45)"}))},de="btn",pe=({children:n,icon:r})=>{const o=fe[r];return t().createElement("span",{className:"".concat(de,"__content")},n&&t().createElement("span",{className:"".concat(de,"__label")},n),r&&t().createElement("span",{className:"".concat(de,"__icon")},(0,e.isValidElement)(r)&&r,o&&t().createElement(o,null)))},he=e=>{const{className:n,type:r="button",el:o,to:i,url:a,children:c,onClick:u,disabled:s,icon:l,iconStyle:f="without-border",buttonStyle:d="primary",round:p,size:h="medium",iconPosition:v="right",newTab:m}=e,y=[de,n&&n,d&&"".concat(de,"--style-").concat(d),l&&"".concat(de,"--icon"),f&&"".concat(de,"--icon-style-").concat(f),l&&!c&&"".concat(de,"--icon-only"),s&&"".concat(de,"--disabled"),p&&"".concat(de,"--round"),h&&"".concat(de,"--size-").concat(h),v&&"".concat(de,"--icon-position-").concat(v)].filter(Boolean).join(" ");const g={type:r,className:y,onClick:function(e){"submit"!==r&&u&&e.preventDefault(),u&&u(e)},rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0};switch(o){case"link":return t().createElement(ae,{...g,to:i||a},t().createElement(pe,{icon:l},c));case"anchor":return t().createElement("a",{...g,href:a},t().createElement(pe,{icon:l},c));default:return t().createElement("button",{type:"submit",...g},t().createElement(pe,{icon:l},c))}};var ve=n(727),me=n(719);const ye=(t,n,r=[])=>{const o=(0,e.useRef)(Date.now());(0,e.useEffect)((()=>{const e=setTimeout((()=>{Date.now()-o.current>=n&&(t(),o.current=Date.now())}),n-(Date.now()-o.current));return()=>{clearTimeout(e)}}),[n,...r])},ge="popup-button",we=e=>{const{buttonType:n,button:r,setActive:o,active:i}=e,a=[ge,"".concat(ge,"--").concat(n)].filter(Boolean).join(" "),c=()=>{o(!i)};return"none"===n?null:"custom"===n?t().createElement("div",{role:"button",tabIndex:0,onKeyDown:e=>{"Enter"===e.key&&c()},onClick:c,className:a},r):t().createElement("button",{type:"button",onClick:()=>o(!i),className:a},r)},be="popup",xe=n=>{const{className:r,render:o,size:i="small",color:a="light",button:c,buttonType:u="default",children:s,showOnHover:l=!1,horizontalAlign:f="left",initActive:d=!1,onToggleOpen:p,padding:h,forceOpen:v}=n,m=(0,e.useRef)(null),y=(0,e.useRef)(null),[g,w]=(0,e.useState)(d),[b,x]=(0,e.useState)("top"),[_,O]=(0,e.useState)(null),{y:E}=(0,me.useScrollInfo)(),{height:P}=(0,ve.useWindowInfo)(),S=e=>{y.current.contains(e.target)||w(!1)};ye((()=>{if(y.current&&m.current){const{height:e,width:t,right:n}=y.current.getBoundingClientRect(),{y:r}=m.current.getBoundingClientRect(),o=window.innerWidth-n,i=n-t;O("left"===f&&o<=0?"right":"right"===f&&i<=0?"left":"center"===f&&(i<=t/2||o<=t/2)?o>i?"left":"right":null),x(r>e?"top":"bottom")}}),500,[x,y,E,P]),(0,e.useEffect)((()=>("function"==typeof p&&p(g),g?document.addEventListener("mousedown",S):document.removeEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)})),[g,p]),(0,e.useEffect)((()=>{w(v)}),[v]);const j=[be,r,"".concat(be,"--size-").concat(i),"".concat(be,"--color-").concat(a),"".concat(be,"--v-align-").concat(b),"".concat(be,"--h-align-").concat(f),_&&"".concat(be,"--force-h-align-").concat(_),g&&"".concat(be,"--active")].filter(Boolean).join(" ");return t().createElement("div",{className:j},t().createElement("div",{ref:m,className:"".concat(be,"__wrapper")},l?t().createElement("div",{className:"".concat(be,"__on-hover-watch"),onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},t().createElement(we,{buttonType:u,button:c,setActive:w,active:g})):t().createElement(we,{buttonType:u,button:c,setActive:w,active:g})),t().createElement("div",{className:"".concat(be,"__content"),ref:y},t().createElement("div",{className:"".concat(be,"__wrap")},t().createElement("div",{className:"".concat(be,"__scroll"),style:{padding:h}},o&&o({close:()=>w(!1)}),s&&s))))},_e="banner",Oe=({children:e,className:n,to:r,icon:o,alignIcon:i="right",onClick:a,type:c="default"})=>{const u=[_e,"".concat(_e,"--type-").concat(c),n&&n,r&&"".concat(_e,"--has-link"),(r||a)&&"".concat(_e,"--has-action"),o&&"".concat(_e,"--has-icon"),o&&"".concat(_e,"--align-icon-").concat(i)].filter(Boolean).join(" ");let s="div";return a&&!r&&(s="button"),r&&(s=ae),t().createElement(s,{className:u,onClick:a,to:r||void 0},o&&"left"===i&&t().createElement(t().Fragment,null,o),t().createElement("span",{className:"".concat(_e,"__content")},e),o&&"right"===i&&t().createElement(t().Fragment,null,o))},Ee="template-minimal",Pe=e=>{const{className:n,style:r={},children:o,width:i="normal"}=e,a=[n,Ee,"".concat(Ee,"--width-").concat(i)].filter(Boolean).join(" ");return t().createElement("section",{className:a,style:r},t().createElement("div",{className:"".concat(Ee,"__wrap")},o))},Se=()=>t().createElement("svg",{className:"icon icon--check",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("path",{d:"M10.6092 16.0192L17.6477 8.98076",className:"stroke",strokeLinecap:"square",strokeLinejoin:"bevel"}),t().createElement("path",{d:"M7.35229 12.7623L10.6092 16.0192",className:"stroke",strokeLinecap:"square",strokeLinejoin:"bevel"})),je=()=>t().createElement("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon icon--search"},t().createElement("circle",{cx:"11.2069",cy:"10.7069",r:"5",stroke:"#333333",strokeWidth:"2"}),t().createElement("line",{x1:"14.914",y1:"13.9998",x2:"20.5002",y2:"19.586",stroke:"#333333",strokeWidth:"2"})),Ce=()=>t().createElement("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t().createElement("rect",{x:"3.5",y:"4.5",width:"18",height:"2",fill:"#333333"}),t().createElement("rect",{x:"3.5",y:"11.5",width:"18",height:"2",fill:"#333333"}),t().createElement("rect",{x:"3.5",y:"18.5",width:"18",height:"2",fill:"#333333"})),ke="pill",Te=({children:e,className:n,to:r,icon:o,alignIcon:i="right",onClick:a,pillStyle:c="light"})=>{const u=[ke,"".concat(ke,"--style-").concat(c),n&&n,r&&"".concat(ke,"--has-link"),(r||a)&&"".concat(ke,"--has-action"),o&&"".concat(ke,"--has-icon"),o&&"".concat(ke,"--align-icon-").concat(i)].filter(Boolean).join(" ");let s="div";return a&&!r&&(s="button"),r&&(s=ae),t().createElement(s,{className:u,onClick:a,type:"button"===s?"button":void 0,to:r||void 0},o&&"left"===i&&t().createElement(t().Fragment,null,o),e,o&&"right"===i&&t().createElement(t().Fragment,null,o))}})(),module.exports=r})();
|
|
9
|
+
*/var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,v=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,g=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case f:case i:case c:case a:case p:return e;default:switch(e=e&&e.$$typeof){case s:case d:case m:case v:case u:return e;default:return t}}case o:return t}}}function _(e){return x(e)===f}t.AsyncMode=l,t.ConcurrentMode=f,t.ContextConsumer=s,t.ContextProvider=u,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=v,t.Portal=o,t.Profiler=c,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return _(e)||x(e)===l},t.isConcurrentMode=_,t.isContextConsumer=function(e){return x(e)===s},t.isContextProvider=function(e){return x(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===d},t.isFragment=function(e){return x(e)===i},t.isLazy=function(e){return x(e)===m},t.isMemo=function(e){return x(e)===v},t.isPortal=function(e){return x(e)===o},t.isProfiler=function(e){return x(e)===c},t.isStrictMode=function(e){return x(e)===a},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===c||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===v||e.$$typeof===u||e.$$typeof===s||e.$$typeof===d||e.$$typeof===g||e.$$typeof===w||e.$$typeof===b||e.$$typeof===y)},t.typeOf=x},864:(e,t,n)=>{"use strict";e.exports=n(921)},658:(e,t,n)=>{var r=n(826);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return c(i(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=d;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,c="",l=t&&t.delimiter||"/";null!=(n=o.exec(e));){var f=n[0],d=n[1],p=n.index;if(c+=e.slice(a,p),a=p+f.length,d)c+=d[1];else{var h=e[a],v=n[2],m=n[3],y=n[4],g=n[5],w=n[6],b=n[7];c&&(r.push(c),c="");var x=null!=v&&null!=h&&h!==v,_="+"===w||"*"===w,O="?"===w||"*"===w,E=n[2]||l,P=y||g;r.push({name:m||i++,prefix:v||"",delimiter:E,optional:O,repeat:_,partial:x,asterisk:!!b,pattern:P?s(P):b?".*":"[^"+u(E)+"]+?"})}}return a<e.length&&(c+=e.substr(a)),c&&r.push(c),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function c(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",f(t)));return function(t,o){for(var i="",c=t||{},u=(o||{}).pretty?a:encodeURIComponent,s=0;s<e.length;s++){var l=e[s];if("string"!=typeof l){var f,d=c[l.name];if(null==d){if(l.optional){l.partial&&(i+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(r(d)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(0===d.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var p=0;p<d.length;p++){if(f=u(d[p]),!n[s].test(f))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(f)+"`");i+=(0===p?l.prefix:l.delimiter)+f}}else{if(f=l.asterisk?encodeURI(d).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):u(d),!n[s].test(f))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+f+'"');i+=l.prefix+f}}else i+=l}return i}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function s(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function f(e){return e&&e.sensitive?"":"i"}function d(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",c=0;c<e.length;c++){var s=e[c];if("string"==typeof s)a+=u(s);else{var d=u(s.prefix),p="(?:"+s.pattern+")";t.push(s),s.repeat&&(p+="(?:"+d+p+")*"),a+=p=s.optional?s.partial?d+"("+p+")?":"(?:"+d+"("+p+"))?":d+"("+p+")"}}var h=u(n.delimiter||"/"),v=a.slice(-h.length)===h;return o||(a=(v?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=i?"$":o&&v?"":"(?="+h+"|$)",l(new RegExp("^"+a,f(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return l(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(p(e[o],t,n).source);return l(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(e,t,n):function(e,t,n){return d(i(e,n),t,n)}(e,t,n)}},497:e=>{"use strict";e.exports=require("react")}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Banner:()=>Oe,Button:()=>he,Check:()=>Se,Chevron:()=>le,Menu:()=>Ce,MinimalTemplate:()=>Pe,Pill:()=>Te,Popup:()=>xe,Search:()=>je,X:()=>se});var e=n(497),t=n.n(e);function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}var a=n(697),c=n.n(a);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function s(e){return"/"===e.charAt(0)}function l(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}const f=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&s(e),a=t&&s(t),c=i||a;if(e&&s(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var u=o[o.length-1];n="."===u||".."===u||""===u}else n=!1;for(var f=0,d=o.length;d>=0;d--){var p=o[d];"."===p?l(o,d):".."===p?(l(o,d),f++):f&&(l(o,d),f--)}if(!c)for(;f--;f)o.unshift("..");!c||""===o[0]||o[0]&&s(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};var d="Invariant failed";function p(e,t){if(!e)throw new Error(d)}function h(e){return"/"===e.charAt(0)?e:"/"+e}function v(e){return"/"===e.charAt(0)?e.substr(1):e}function m(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function y(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function g(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function w(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=u({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=f(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function b(){var e=null;var t=[];return{setPrompt:function(t){return t,function(){e===t&&null}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){!1,t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var x=!("undefined"==typeof window||!window.document||!window.document.createElement);function _(e,t){t(window.confirm(e))}var O="popstate",E="hashchange";function P(){try{return window.history.state||{}}catch(e){return{}}}function S(e){void 0===e&&{},x||p(!1);var t,n=window.history,r=(-1===window.navigator.userAgent.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,a=i.forceRefresh,c=void 0!==a&&a,s=i.getUserConfirmation,l=void 0===s?_:s,f=i.keyLength,d=void 0===f?6:f,v=e.basename?y(h(e.basename)):"";function S(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return v&&m(i,v),w(i,r,n)}function j(){return Math.random().toString(36).substr(2,d)}var C=b();function k(e){u(F,e),F.length=n.length,C.notifyListeners(F.location,F.action)}function T(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||I(S(e.state))}function M(){I(S(P()))}var A=!1;function I(e){if(A)!1,k();else{C.confirmTransitionTo(e,"POP",l,(function(t){t?k({action:"POP",location:e}):function(e){var t=F.location,n=L.indexOf(t.key);-1===n&&0;var r=L.indexOf(e.key);-1===r&&0;var o=n-r;o&&(!0,D(o))}(e)}))}}var N=S(P()),L=[N.key];function R(e){return v+g(e)}function D(e){n.go(e)}var $=0;function W(e){1===($+=e)&&1===e?(window.addEventListener(O,T),o&&window.addEventListener(E,M)):0===$&&(window.removeEventListener(O,T),o&&window.removeEventListener(E,M))}var B=!1;var F={length:n.length,action:"POP",location:N,createHref:R,push:function(e,t){var o="PUSH",i=w(e,t,j(),F.location);C.confirmTransitionTo(i,o,l,(function(e){if(e){var t=R(i),a=i.key,u=i.state;if(r)if(n.pushState({key:a,state:u},null,t),c)window.location.href=t;else{var s=L.indexOf(F.location.key),l=L.slice(0,s+1);l.push(i.key),l,k({action:o,location:i})}else window.location.href=t}}))},replace:function(e,t){var o="REPLACE",i=w(e,t,j(),F.location);C.confirmTransitionTo(i,o,l,(function(e){if(e){var t=R(i),a=i.key,u=i.state;if(r)if(n.replaceState({key:a,state:u},null,t),c)window.location.replace(t);else{var s=L.indexOf(F.location.key);-1!==s&&(L[s]=i.key),k({action:o,location:i})}else window.location.replace(t)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&!1;var t=C.setPrompt(e);return B||(W(1),!0),function(){return B&&(!1,W(-1)),t()}},listen:function(e){var t=C.appendListener(e);return W(1),function(){W(-1),t()}}};return F}var j="hashchange",C={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+v(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:v,decodePath:h},slash:{encodePath:h,decodePath:h}};function k(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function T(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function M(e){window.location.replace(k(window.location.href)+"#"+e)}function A(e){void 0===e&&{},x||p(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,o=void 0===r?_:r,i=n.hashType,a=void 0===i?"slash":i,c=e.basename?y(h(e.basename)):"",s=C[a],l=s.encodePath,f=s.decodePath;function d(){var e=f(T());return c&&m(e,c),w(e)}var v=b();function O(e){u(B,e),B.length=t.length,v.notifyListeners(B.location,B.action)}var E=!1,P=null;function S(){var e,t,n=T(),r=l(n);if(n!==r)M(r);else{var i=d(),a=B.location;if(!E&&(i,a.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(P===g(i))return;null,function(e){if(E)!1,O();else{var t="POP";v.confirmTransitionTo(e,t,o,(function(n){n?O({action:t,location:e}):function(e){var t=B.location,n=L.lastIndexOf(g(t));-1===n&&0;var r=L.lastIndexOf(g(e));-1===r&&0;var o=n-r;o&&(!0,R(o))}(e)}))}}(i)}}var A=T(),I=l(A);A!==I&&M(I);var N=d(),L=[g(N)];function R(e){t.go(e)}var D=0;function $(e){1===(D+=e)&&1===e?window.addEventListener(j,S):0===D&&window.removeEventListener(j,S)}var W=!1;var B={length:t.length,action:"POP",location:N,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&k(window.location.href),n+"#"+l(c+g(e))},push:function(e,t){var n="PUSH",r=w(e,void 0,void 0,B.location);v.confirmTransitionTo(r,n,o,(function(e){if(e){var t=g(r),o=l(c+t);if(T()!==o){t,function(e){window.location.hash=e}(o);var i=L.lastIndexOf(g(B.location)),a=L.slice(0,i+1);a.push(t),a,O({action:n,location:r})}else O()}}))},replace:function(e,t){var n="REPLACE",r=w(e,void 0,void 0,B.location);v.confirmTransitionTo(r,n,o,(function(e){if(e){var t=g(r),o=l(c+t);T()!==o&&(t,M(o));var i=L.indexOf(g(B.location));-1!==i&&(L[i]=t),O({action:n,location:r})}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&!1;var t=v.setPrompt(e);return W||($(1),!0),function(){return W&&(!1,$(-1)),t()}},listen:function(e){var t=v.appendListener(e);return $(1),function(){$(-1),t()}}};return B}function I(e,t,n){return Math.min(Math.max(e,t),n)}function N(e){void 0===e&&{};var t=e,n=t.getUserConfirmation,r=t.initialEntries,o=void 0===r?["/"]:r,i=t.initialIndex,a=void 0===i?0:i,c=t.keyLength,s=void 0===c?6:c,l=b();function f(e){u(y,e),y.length=y.entries.length,l.notifyListeners(y.location,y.action)}function d(){return Math.random().toString(36).substr(2,s)}var p=I(a,0,o.length-1),h=o.map((function(e){return w(e,void 0,"string"==typeof e?d():e.key||d())})),v=g;function m(e){var t=I(y.index+e,0,y.entries.length-1),r=y.entries[t];l.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var y={length:h.length,action:"POP",location:h[p],index:p,entries:h,createHref:v,push:function(e,t){var r="PUSH",o=w(e,t,d(),y.location);l.confirmTransitionTo(o,r,n,(function(e){if(e){var t=y.index+1,n=y.entries.slice(0);n.length>t?n.splice(t,n.length-t,o):n.push(o),f({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=w(e,t,d(),y.location);l.confirmTransitionTo(o,r,n,(function(e){e&&(y.entries[y.index]=o,f({action:r,location:o}))}))},go:m,goBack:function(){m(-1)},goForward:function(){m(1)},canGo:function(e){var t=y.index+e;return t>=0&&t<y.entries.length},block:function(e){return void 0===e&&!1,l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return y}var L=1073741823,R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function D(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var $=t().createContext||function(t,n){var r,o,a="__create-react-context-"+function(){var e="__global_unique_id__";return R[e]=(R[e]||0)+1}()+"__",u=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).emitter=D(t.props.value),t}i(t,e);var r=t.prototype;return r.getChildContext=function(){var e;return(e={})[a]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?t=0:(t="function"==typeof n?n(r,o):L,0!==(t|=0)&&this.emitter.set(e.value,t))}var i,a},r.render=function(){return this.props.children},t}(e.Component);u.childContextTypes=((r={})[a]=c().object.isRequired,r);var s=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,n){0!=((0|t.observedBits)&n)&&t.setState({value:t.getValue()})},t}i(n,e);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?L:t},r.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?L:e},r.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},r.getValue=function(){return this.context[a]?this.context[a].get():t},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(e.Component);return s.contextTypes=((o={})[a]=c().object,o),{Provider:u,Consumer:s}};const W=$;var B=n(658),F=n.n(B);n(864);function U(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n(679);var q=function(e){var t=W();return t.displayName=e,t},H=q("Router-History"),z=q("Router"),V=function(e){function n(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}i(n,e),n.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var r=n.prototype;return r.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},r.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},r.render=function(){return t().createElement(z.Provider,{value:{history:this.props.history,location:this.state.location,match:n.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},t().createElement(H.Provider,{children:this.props.children||null,value:this.props.history}))},n}(t().Component);t().Component;t().Component;var K={},J=0;function X(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,c=void 0!==a&&a,u=n.sensitive,s=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=K[n]||(K[n]={});if(r[e])return r[e];var o=[],i={regexp:F()(e,o,t),keys:o};return J<1e4&&(r[e]=i,J++),i}(n,{end:i,strict:c,sensitive:s}),o=r.regexp,a=r.keys,u=o.exec(e);if(!u)return null;var l=u[0],f=u.slice(1),d=e===l;return i&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}t().Component;function Y(e){return"/"===e.charAt(0)?e:"/"+e}function G(e,t){if(!e)return t;var n=Y(e);return 0!==t.pathname.indexOf(n)?t:u({},t,{pathname:t.pathname.substr(n.length)})}function Q(e){return"string"==typeof e?e:g(e)}function Z(e){return function(){p(!1)}}function ee(){}t().Component;t().Component;t().useContext;t().Component;t().Component;var te=function(e,t){return"function"==typeof e?e(t):e},ne=function(e,t){return"string"==typeof e?w(e,null,null,t):e},re=function(e){return e},oe=t().forwardRef;void 0===oe&&(oe=re);var ie=oe((function(e,n){var r=e.innerRef,o=e.navigate,i=e.onClick,a=U(e,["innerRef","navigate","onClick"]),c=a.target,s=u({},a,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||c&&"_self"!==c||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),o())}});return s.ref=re!==oe&&n||r,t().createElement("a",s)}));var ae=oe((function(e,n){var r=e.component,o=void 0===r?ie:r,i=e.replace,a=e.to,c=e.innerRef,s=U(e,["component","replace","to","innerRef"]);return t().createElement(z.Consumer,null,(function(e){e||p(!1);var r=e.history,l=ne(te(a,e.location),e.location),f=l?r.createHref(l):"",d=u({},s,{href:f,navigate:function(){var t=te(a,e.location),n=g(e.location)===g(ne(t));(i||n?r.replace:r.push)(t)}});return re!==oe?d.ref=n||c:d.innerRef=c,t().createElement(o,d)}))})),ce=function(e){return e},ue=t().forwardRef;void 0===ue&&(ue=ce);ue((function(e,n){var r=e["aria-current"],o=void 0===r?"page":r,i=e.activeClassName,a=void 0===i?"active":i,c=e.activeStyle,s=e.className,l=e.exact,f=e.isActive,d=e.location,h=e.sensitive,v=e.strict,m=e.style,y=e.to,g=e.innerRef,w=U(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return t().createElement(z.Consumer,null,(function(e){e||p(!1);var r=d||e.location,i=ne(te(y,r),r),b=i.pathname,x=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),_=x?X(r.pathname,{path:x,exact:l,sensitive:h,strict:v}):null,O=!!(f?f(_,r):_),E="function"==typeof s?s(O):s,P="function"==typeof m?m(O):m;O&&(E=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(E,a),P=u({},P,c));var S=u({"aria-current":O&&o||null,className:E,style:P,to:i},w);return ce!==ue?S.ref=n||g:S.innerRef=g,t().createElement(ae,S)}))}));const se=()=>t().createElement("svg",{width:"25",height:"25",className:"icon icon--x",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("line",{className:"stroke",x1:"8.74612",y1:"16.347",x2:"16.3973",y2:"8.69584"}),t().createElement("line",{className:"stroke",x1:"8.6027",y1:"8.69585",x2:"16.2539",y2:"16.3471"})),le=e=>{let{className:n}=e;return t().createElement("svg",{className:["icon icon--chevron",n].filter(Boolean).join(" "),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("path",{className:"stroke",d:"M9 10.5L12.5 14.5L16 10.5"}))},fe={plus:()=>t().createElement("svg",{className:"icon icon--plus",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("line",{x1:"12.4589",y1:"16.9175",x2:"12.4589",y2:"8.50115",className:"stroke"}),t().createElement("line",{x1:"8.05164",y1:"12.594",x2:"16.468",y2:"12.594",className:"stroke"})),x:se,chevron:le,edit:()=>t().createElement("svg",{className:"icon icon--edit",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("polygon",{className:"fill",points:"16.92 16.86 8.25 16.86 8.25 8.21 12.54 8.21 12.54 6.63 6.68 6.63 6.68 18.43 18.5 18.43 18.5 12.53 16.92 12.53 16.92 16.86"}),t().createElement("polygon",{className:"fill",points:"16.31 7.33 17.42 8.44 12.66 13.2 11.51 13.24 11.55 12.09 16.31 7.33"}),t().createElement("rect",{className:"fill",x:"16.94",y:"6.44",width:"1.58",height:"1.15",transform:"translate(10.16 -10.48) rotate(45)"}))},de="btn",pe=n=>{let{children:r,icon:o}=n;const i=fe[o];return t().createElement("span",{className:"".concat(de,"__content")},r&&t().createElement("span",{className:"".concat(de,"__label")},r),o&&t().createElement("span",{className:"".concat(de,"__icon")},(0,e.isValidElement)(o)&&o,i&&t().createElement(i,null)))},he=e=>{const{className:n,type:r="button",el:o,to:i,url:a,children:c,onClick:u,disabled:s,icon:l,iconStyle:f="without-border",buttonStyle:d="primary",round:p,size:h="medium",iconPosition:v="right",newTab:m}=e,y=[de,n&&n,d&&"".concat(de,"--style-").concat(d),l&&"".concat(de,"--icon"),f&&"".concat(de,"--icon-style-").concat(f),l&&!c&&"".concat(de,"--icon-only"),s&&"".concat(de,"--disabled"),p&&"".concat(de,"--round"),h&&"".concat(de,"--size-").concat(h),v&&"".concat(de,"--icon-position-").concat(v)].filter(Boolean).join(" ");const g={type:r,className:y,onClick:function(e){"submit"!==r&&u&&e.preventDefault(),u&&u(e)},rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0};switch(o){case"link":return t().createElement(ae,{...g,to:i||a},t().createElement(pe,{icon:l},c));case"anchor":return t().createElement("a",{...g,href:a},t().createElement(pe,{icon:l},c));default:return t().createElement("button",{type:"submit",...g},t().createElement(pe,{icon:l},c))}};var ve=n(727),me=n(719);const ye=function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=(0,e.useRef)(Date.now());(0,e.useEffect)((()=>{const e=setTimeout((()=>{Date.now()-o.current>=n&&(t(),o.current=Date.now())}),n-(Date.now()-o.current));return()=>{clearTimeout(e)}}),[n,...r])},ge="popup-button",we=e=>{const{buttonType:n,button:r,setActive:o,active:i}=e,a=[ge,"".concat(ge,"--").concat(n)].filter(Boolean).join(" "),c=()=>{o(!i)};return"none"===n?null:"custom"===n?t().createElement("div",{role:"button",tabIndex:0,onKeyDown:e=>{"Enter"===e.key&&c()},onClick:c,className:a},r):t().createElement("button",{type:"button",onClick:()=>o(!i),className:a},r)},be="popup",xe=n=>{const{className:r,render:o,size:i="small",color:a="light",button:c,buttonType:u="default",children:s,showOnHover:l=!1,horizontalAlign:f="left",initActive:d=!1,onToggleOpen:p,padding:h,forceOpen:v}=n,m=(0,e.useRef)(null),y=(0,e.useRef)(null),[g,w]=(0,e.useState)(d),[b,x]=(0,e.useState)("top"),[_,O]=(0,e.useState)(null),{y:E}=(0,me.useScrollInfo)(),{height:P}=(0,ve.useWindowInfo)(),S=e=>{y.current.contains(e.target)||w(!1)};ye((()=>{if(y.current&&m.current){const{height:e,width:t,right:n}=y.current.getBoundingClientRect(),{y:r}=m.current.getBoundingClientRect(),o=window.innerWidth-n,i=n-t;O("left"===f&&o<=0?"right":"right"===f&&i<=0?"left":"center"===f&&(i<=t/2||o<=t/2)?o>i?"left":"right":null),x(r>e?"top":"bottom")}}),500,[x,y,E,P]),(0,e.useEffect)((()=>("function"==typeof p&&p(g),g?document.addEventListener("mousedown",S):document.removeEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)})),[g,p]),(0,e.useEffect)((()=>{w(v)}),[v]);const j=[be,r,"".concat(be,"--size-").concat(i),"".concat(be,"--color-").concat(a),"".concat(be,"--v-align-").concat(b),"".concat(be,"--h-align-").concat(f),_&&"".concat(be,"--force-h-align-").concat(_),g&&"".concat(be,"--active")].filter(Boolean).join(" ");return t().createElement("div",{className:j},t().createElement("div",{ref:m,className:"".concat(be,"__wrapper")},l?t().createElement("div",{className:"".concat(be,"__on-hover-watch"),onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},t().createElement(we,{buttonType:u,button:c,setActive:w,active:g})):t().createElement(we,{buttonType:u,button:c,setActive:w,active:g})),t().createElement("div",{className:"".concat(be,"__content"),ref:y},t().createElement("div",{className:"".concat(be,"__wrap")},t().createElement("div",{className:"".concat(be,"__scroll"),style:{padding:h}},o&&o({close:()=>w(!1)}),s&&s))))},_e="banner",Oe=e=>{let{children:n,className:r,to:o,icon:i,alignIcon:a="right",onClick:c,type:u="default"}=e;const s=[_e,"".concat(_e,"--type-").concat(u),r&&r,o&&"".concat(_e,"--has-link"),(o||c)&&"".concat(_e,"--has-action"),i&&"".concat(_e,"--has-icon"),i&&"".concat(_e,"--align-icon-").concat(a)].filter(Boolean).join(" ");let l="div";return c&&!o&&(l="button"),o&&(l=ae),t().createElement(l,{className:s,onClick:c,to:o||void 0},i&&"left"===a&&t().createElement(t().Fragment,null,i),t().createElement("span",{className:"".concat(_e,"__content")},n),i&&"right"===a&&t().createElement(t().Fragment,null,i))},Ee="template-minimal",Pe=e=>{const{className:n,style:r={},children:o,width:i="normal"}=e,a=[n,Ee,"".concat(Ee,"--width-").concat(i)].filter(Boolean).join(" ");return t().createElement("section",{className:a,style:r},t().createElement("div",{className:"".concat(Ee,"__wrap")},o))},Se=()=>t().createElement("svg",{className:"icon icon--check",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},t().createElement("path",{d:"M10.6092 16.0192L17.6477 8.98076",className:"stroke",strokeLinecap:"square",strokeLinejoin:"bevel"}),t().createElement("path",{d:"M7.35229 12.7623L10.6092 16.0192",className:"stroke",strokeLinecap:"square",strokeLinejoin:"bevel"})),je=()=>t().createElement("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"icon icon--search"},t().createElement("circle",{cx:"11.2069",cy:"10.7069",r:"5",stroke:"#333333",strokeWidth:"2"}),t().createElement("line",{x1:"14.914",y1:"13.9998",x2:"20.5002",y2:"19.586",stroke:"#333333",strokeWidth:"2"})),Ce=()=>t().createElement("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t().createElement("rect",{x:"3.5",y:"4.5",width:"18",height:"2",fill:"#333333"}),t().createElement("rect",{x:"3.5",y:"11.5",width:"18",height:"2",fill:"#333333"}),t().createElement("rect",{x:"3.5",y:"18.5",width:"18",height:"2",fill:"#333333"})),ke="pill",Te=e=>{let{children:n,className:r,to:o,icon:i,alignIcon:a="right",onClick:c,pillStyle:u="light"}=e;const s=[ke,"".concat(ke,"--style-").concat(u),r&&r,o&&"".concat(ke,"--has-link"),(o||c)&&"".concat(ke,"--has-action"),i&&"".concat(ke,"--has-icon"),i&&"".concat(ke,"--align-icon-").concat(a)].filter(Boolean).join(" ");let l="div";return c&&!o&&(l="button"),o&&(l=ae),t().createElement(l,{className:s,onClick:c,type:"button"===l?"button":void 0,to:o||void 0},i&&"left"===a&&t().createElement(t().Fragment,null,i),n,i&&"right"===a&&t().createElement(t().Fragment,null,i))}})(),module.exports=r})();
|
|
@@ -13,7 +13,7 @@ const SearchFilter = (props) => {
|
|
|
13
13
|
const [search, setSearch] = useState(() => { var _a, _b; return ((_b = (_a = params === null || params === void 0 ? void 0 : params.where) === null || _a === void 0 ? void 0 : _a[fieldName]) === null || _b === void 0 ? void 0 : _b.like) || ''; });
|
|
14
14
|
const debouncedSearch = useDebounce(search, 300);
|
|
15
15
|
useEffect(() => {
|
|
16
|
-
var _a, _b;
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
17
|
if (debouncedSearch !== ((_b = (_a = params === null || params === void 0 ? void 0 : params.where) === null || _a === void 0 ? void 0 : _a[fieldName]) === null || _b === void 0 ? void 0 : _b.like)) {
|
|
18
18
|
const newWhere = {
|
|
19
19
|
...(typeof (params === null || params === void 0 ? void 0 : params.where) === 'object' ? params.where : {}),
|
|
@@ -21,9 +21,12 @@ const SearchFilter = (props) => {
|
|
|
21
21
|
like: debouncedSearch,
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
|
+
if (!debouncedSearch) {
|
|
25
|
+
delete newWhere[fieldName];
|
|
26
|
+
}
|
|
24
27
|
if (handleChange)
|
|
25
28
|
handleChange(newWhere);
|
|
26
|
-
if (modifySearchQuery) {
|
|
29
|
+
if (modifySearchQuery && ((_d = (_c = params === null || params === void 0 ? void 0 : params.where) === null || _c === void 0 ? void 0 : _c[fieldName]) === null || _d === void 0 ? void 0 : _d.like) !== ((_e = newWhere === null || newWhere === void 0 ? void 0 : newWhere[fieldName]) === null || _e === void 0 ? void 0 : _e.like)) {
|
|
27
30
|
history.replace({
|
|
28
31
|
search: queryString.stringify({
|
|
29
32
|
...params,
|
|
@@ -35,7 +38,7 @@ const SearchFilter = (props) => {
|
|
|
35
38
|
}
|
|
36
39
|
}, [debouncedSearch, history, fieldName, params, handleChange, modifySearchQuery]);
|
|
37
40
|
return (React.createElement("div", { className: baseClass },
|
|
38
|
-
React.createElement("input", { className: `${baseClass}__input`, placeholder: `Search by ${fieldLabel}`, type: "text", value: search, onChange: (e) => setSearch(e.target.value) }),
|
|
41
|
+
React.createElement("input", { className: `${baseClass}__input`, placeholder: `Search by ${fieldLabel}`, type: "text", value: search || '', onChange: (e) => setSearch(e.target.value) }),
|
|
39
42
|
React.createElement(Search, null)));
|
|
40
43
|
};
|
|
41
44
|
export default SearchFilter;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import Pill from '../../../elements/Pill';
|
|
4
4
|
import './index.scss';
|
|
5
5
|
const baseClass = 'section-title';
|
|
6
6
|
const SectionTitle = (props) => {
|
|
7
7
|
const { label, path, readOnly } = props;
|
|
8
|
-
const { value, setValue } =
|
|
8
|
+
const { value, setValue } = useField({ path });
|
|
9
9
|
const classes = [
|
|
10
10
|
baseClass,
|
|
11
11
|
].filter(Boolean).join(' ');
|
|
@@ -6,7 +6,7 @@ import DraggableSection from '../../DraggableSection';
|
|
|
6
6
|
import reducer from '../rowReducer';
|
|
7
7
|
import { useForm } from '../../Form/context';
|
|
8
8
|
import buildStateFromSchema from '../../Form/buildStateFromSchema';
|
|
9
|
-
import
|
|
9
|
+
import useField from '../../useField';
|
|
10
10
|
import Error from '../../Error';
|
|
11
11
|
import { array } from '../../../../../fields/validations';
|
|
12
12
|
import Banner from '../../../elements/Banner';
|
|
@@ -36,7 +36,7 @@ const ArrayFieldType = (props) => {
|
|
|
36
36
|
return validationResult;
|
|
37
37
|
}, [validate, maxRows, minRows, required]);
|
|
38
38
|
const [disableFormData, setDisableFormData] = useState(false);
|
|
39
|
-
const { showError, errorMessage, value, setValue, } =
|
|
39
|
+
const { showError, errorMessage, value, setValue, } = useField({
|
|
40
40
|
path,
|
|
41
41
|
validate: memoizedValidate,
|
|
42
42
|
disableFormData,
|
|
@@ -9,7 +9,7 @@ import { useForm } from '../../Form/context';
|
|
|
9
9
|
import buildStateFromSchema from '../../Form/buildStateFromSchema';
|
|
10
10
|
import DraggableSection from '../../DraggableSection';
|
|
11
11
|
import Error from '../../Error';
|
|
12
|
-
import
|
|
12
|
+
import useField from '../../useField';
|
|
13
13
|
import Popup from '../../../elements/Popup';
|
|
14
14
|
import BlockSelector from './BlockSelector';
|
|
15
15
|
import { blocks as blocksValidator } from '../../../../../fields/validations';
|
|
@@ -36,7 +36,7 @@ const Blocks = (props) => {
|
|
|
36
36
|
return validationResult;
|
|
37
37
|
}, [validate, maxRows, minRows, labels, blocks, required]);
|
|
38
38
|
const [disableFormData, setDisableFormData] = useState(false);
|
|
39
|
-
const { showError, errorMessage, value, setValue, } =
|
|
39
|
+
const { showError, errorMessage, value, setValue, } = useField({
|
|
40
40
|
path,
|
|
41
41
|
validate: memoizedValidate,
|
|
42
42
|
disableFormData,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import withCondition from '../../withCondition';
|
|
4
4
|
import Error from '../../Error';
|
|
5
5
|
import { checkbox } from '../../../../../fields/validations';
|
|
@@ -14,7 +14,7 @@ const Checkbox = (props) => {
|
|
|
14
14
|
const validationResult = validate(value, { required });
|
|
15
15
|
return validationResult;
|
|
16
16
|
}, [validate, required]);
|
|
17
|
-
const { value, showError, errorMessage, setValue, } =
|
|
17
|
+
const { value, showError, errorMessage, setValue, } = useField({
|
|
18
18
|
path,
|
|
19
19
|
validate: memoizedValidate,
|
|
20
20
|
disableFormData,
|
|
@@ -3,7 +3,7 @@ import Editor from 'react-simple-code-editor';
|
|
|
3
3
|
import { highlight, languages } from 'prismjs/components/prism-core';
|
|
4
4
|
import 'prismjs/components/prism-clike';
|
|
5
5
|
import 'prismjs/components/prism-javascript';
|
|
6
|
-
import
|
|
6
|
+
import useField from '../../useField';
|
|
7
7
|
import withCondition from '../../withCondition';
|
|
8
8
|
import Label from '../../Label';
|
|
9
9
|
import Error from '../../Error';
|
|
@@ -23,7 +23,7 @@ const Code = (props) => {
|
|
|
23
23
|
const validationResult = validate(value, { minLength, maxLength, required });
|
|
24
24
|
return validationResult;
|
|
25
25
|
}, [validate, maxLength, minLength, required]);
|
|
26
|
-
const { value, showError, setValue, errorMessage, } =
|
|
26
|
+
const { value, showError, setValue, errorMessage, } = useField({
|
|
27
27
|
path,
|
|
28
28
|
validate: memoizedValidate,
|
|
29
29
|
enableDebouncedValue: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import Label from '../../Label';
|
|
4
4
|
import Error from '../../Error';
|
|
5
5
|
import { useWatchForm } from '../../Form/context';
|
|
@@ -13,7 +13,7 @@ const ConfirmPassword = () => {
|
|
|
13
13
|
}
|
|
14
14
|
return 'Passwords do not match.';
|
|
15
15
|
}, [password]);
|
|
16
|
-
const { value, showError, setValue, errorMessage, } =
|
|
16
|
+
const { value, showError, setValue, errorMessage, } = useField({
|
|
17
17
|
path: 'confirm-password',
|
|
18
18
|
disableFormData: true,
|
|
19
19
|
validate,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import DatePicker from '../../../elements/DatePicker';
|
|
3
3
|
import withCondition from '../../withCondition';
|
|
4
|
-
import
|
|
4
|
+
import useField from '../../useField';
|
|
5
5
|
import Label from '../../Label';
|
|
6
6
|
import Error from '../../Error';
|
|
7
7
|
import FieldDescription from '../../FieldDescription';
|
|
@@ -15,7 +15,7 @@ const DateTime = (props) => {
|
|
|
15
15
|
const validationResult = validate(value, { required });
|
|
16
16
|
return validationResult;
|
|
17
17
|
}, [validate, required]);
|
|
18
|
-
const { value, showError, errorMessage, setValue, } =
|
|
18
|
+
const { value, showError, errorMessage, setValue, } = useField({
|
|
19
19
|
path,
|
|
20
20
|
validate: memoizedValidate,
|
|
21
21
|
condition,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import withCondition from '../../withCondition';
|
|
3
|
-
import
|
|
3
|
+
import useField from '../../useField';
|
|
4
4
|
import Label from '../../Label';
|
|
5
5
|
import Error from '../../Error';
|
|
6
6
|
import FieldDescription from '../../FieldDescription';
|
|
@@ -13,7 +13,7 @@ const Email = (props) => {
|
|
|
13
13
|
const validationResult = validate(value, { required });
|
|
14
14
|
return validationResult;
|
|
15
15
|
}, [validate, required]);
|
|
16
|
-
const fieldType =
|
|
16
|
+
const fieldType = useField({
|
|
17
17
|
path,
|
|
18
18
|
validate: memoizedValidate,
|
|
19
19
|
enableDebouncedValue: true,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import withCondition from '../../withCondition';
|
|
4
4
|
const HiddenInput = (props) => {
|
|
5
5
|
const { name, path: pathFromProps, value: valueFromProps, modifyForm = true, } = props;
|
|
6
6
|
const path = pathFromProps || name;
|
|
7
|
-
const { value, setValue } =
|
|
7
|
+
const { value, setValue } = useField({
|
|
8
8
|
path,
|
|
9
9
|
});
|
|
10
10
|
useEffect(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import Label from '../../Label';
|
|
4
4
|
import Error from '../../Error';
|
|
5
5
|
import FieldDescription from '../../FieldDescription';
|
|
@@ -13,7 +13,7 @@ const NumberField = (props) => {
|
|
|
13
13
|
const validationResult = validate(value, { min, max, required });
|
|
14
14
|
return validationResult;
|
|
15
15
|
}, [validate, max, min, required]);
|
|
16
|
-
const { value, showError, setValue, errorMessage, } =
|
|
16
|
+
const { value, showError, setValue, errorMessage, } = useField({
|
|
17
17
|
path,
|
|
18
18
|
validate: memoizedValidate,
|
|
19
19
|
enableDebouncedValue: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import Label from '../../Label';
|
|
4
4
|
import Error from '../../Error';
|
|
5
5
|
import withCondition from '../../withCondition';
|
|
@@ -12,7 +12,7 @@ const Password = (props) => {
|
|
|
12
12
|
const validationResult = validate(value, { required });
|
|
13
13
|
return validationResult;
|
|
14
14
|
}, [validate, required]);
|
|
15
|
-
const { value, showError, formProcessing, setValue, errorMessage, } =
|
|
15
|
+
const { value, showError, formProcessing, setValue, errorMessage, } = useField({
|
|
16
16
|
path,
|
|
17
17
|
validate: memoizedValidate,
|
|
18
18
|
enableDebouncedValue: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import Label from '../../Label';
|
|
4
4
|
import Error from '../../Error';
|
|
5
5
|
import FieldDescription from '../../FieldDescription';
|
|
@@ -14,7 +14,7 @@ const PointField = (props) => {
|
|
|
14
14
|
const validationResult = validate(value, { required });
|
|
15
15
|
return validationResult;
|
|
16
16
|
}, [validate, required]);
|
|
17
|
-
const { value = [null, null], showError, setValue, errorMessage, } =
|
|
17
|
+
const { value = [null, null], showError, setValue, errorMessage, } = useField({
|
|
18
18
|
path,
|
|
19
19
|
validate: memoizedValidate,
|
|
20
20
|
enableDebouncedValue: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useField from '../../useField';
|
|
3
3
|
import withCondition from '../../withCondition';
|
|
4
4
|
import Error from '../../Error';
|
|
5
5
|
import Label from '../../Label';
|
|
@@ -16,7 +16,7 @@ const RadioGroup = (props) => {
|
|
|
16
16
|
const validationResult = validate(value, { required, options });
|
|
17
17
|
return validationResult;
|
|
18
18
|
}, [validate, required, options]);
|
|
19
|
-
const { value, showError, errorMessage, setValue, } =
|
|
19
|
+
const { value, showError, errorMessage, setValue, } = useField({
|
|
20
20
|
path,
|
|
21
21
|
validate: memoizedValidate,
|
|
22
22
|
condition,
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState, useReducer, } from 'react';
|
|
|
2
2
|
import { useConfig } from '@payloadcms/config-provider';
|
|
3
3
|
import withCondition from '../../withCondition';
|
|
4
4
|
import ReactSelect from '../../../elements/ReactSelect';
|
|
5
|
-
import
|
|
5
|
+
import useField from '../../useField';
|
|
6
6
|
import Label from '../../Label';
|
|
7
7
|
import Error from '../../Error';
|
|
8
8
|
import FieldDescription from '../../FieldDescription';
|
|
@@ -29,7 +29,7 @@ const Relationship = (props) => {
|
|
|
29
29
|
const validationResult = validate(value, { required });
|
|
30
30
|
return validationResult;
|
|
31
31
|
}, [validate, required]);
|
|
32
|
-
const { value, showError, errorMessage, setValue, } =
|
|
32
|
+
const { value, showError, errorMessage, setValue, } = useField({
|
|
33
33
|
path: path || name,
|
|
34
34
|
validate: memoizedValidate,
|
|
35
35
|
condition,
|
|
@@ -4,7 +4,7 @@ import { createEditor, Transforms, Node, Element as SlateElement, Text } from 's
|
|
|
4
4
|
import { Editable, withReact, Slate } from 'slate-react';
|
|
5
5
|
import { withHistory } from 'slate-history';
|
|
6
6
|
import { richText } from '../../../../../fields/validations';
|
|
7
|
-
import
|
|
7
|
+
import useField from '../../useField';
|
|
8
8
|
import withCondition from '../../withCondition';
|
|
9
9
|
import Label from '../../Label';
|
|
10
10
|
import Error from '../../Error';
|
|
@@ -53,7 +53,7 @@ const RichText = (props) => {
|
|
|
53
53
|
const validationResult = validate(value, { required });
|
|
54
54
|
return validationResult;
|
|
55
55
|
}, [validate, required]);
|
|
56
|
-
const fieldType =
|
|
56
|
+
const fieldType = useField({
|
|
57
57
|
path,
|
|
58
58
|
validate: memoizedValidate,
|
|
59
59
|
stringify: true,
|