@blaze-cms/react-page-builder 0.131.0-project-admin-customisations.2 → 0.131.1
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 +5 -21
- package/lib/HOC/recreateOnNavigation.js +29 -0
- package/lib/HOC/recreateOnNavigation.js.map +1 -0
- package/lib/components/Button.js +1 -2
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +5 -5
- package/lib/components/Card/CardsContainer.js.map +1 -1
- package/lib/components/Card/CardsRender.js +6 -13
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/helpers/index.js +0 -7
- package/lib/components/Card/helpers/index.js.map +1 -1
- package/lib/components/Code/Code.js +3 -7
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/ContentGroupSection/ContentGroupSection.js +4 -1
- package/lib/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -3
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js +2 -3
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/Layout/Layout.js +3 -2
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/LayoutFactory.js +35 -0
- package/lib/components/Layout/LayoutFactory.js.map +1 -0
- package/lib/components/Layout/LayoutWithStickyTimer.js +66 -0
- package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -0
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/List/ListFactory.js +11 -16
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/helpers/index.js +0 -14
- package/lib/components/List/helpers/index.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +6 -8
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +11 -17
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +85 -63
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +1 -3
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-new-query.js +15 -0
- package/lib/components/SearchFilter/helpers/build-new-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/build-query.js +37 -0
- package/lib/components/SearchFilter/helpers/build-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +43 -0
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
- package/lib/components/SearchFilter/helpers/index.js +11 -18
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib/components/SearchFilter/index.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js +11 -31
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +5 -19
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js +5 -9
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js +0 -2
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-props-query.js +2 -5
- package/lib/helpers/build-props-query.js.map +1 -1
- package/lib/helpers/build-set-filters.js +1 -5
- package/lib/helpers/build-set-filters.js.map +1 -1
- package/lib/helpers/get-query-filters.js +8 -6
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js +2 -13
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-wrapped-value-with-link.js +3 -2
- package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib/helpers/index.js +0 -14
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js +8 -13
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/utils/get-class-modifiers.js +1 -1
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib-es/HOC/recreateOnNavigation.js +20 -0
- package/lib-es/HOC/recreateOnNavigation.js.map +1 -0
- package/lib-es/components/Button.js +1 -2
- package/lib-es/components/Button.js.map +1 -1
- package/lib-es/components/Card/CardsContainer.js +5 -5
- package/lib-es/components/Card/CardsContainer.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +7 -14
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/Card/helpers/index.js +0 -1
- package/lib-es/components/Card/helpers/index.js.map +1 -1
- package/lib-es/components/Code/Code.js +4 -8
- package/lib-es/components/Code/Code.js.map +1 -1
- package/lib-es/components/ContentGroupSection/ContentGroupSection.js +8 -4
- package/lib-es/components/ContentGroupSection/ContentGroupSection.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +1 -3
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -4
- package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib-es/components/Layout/Layout.js +3 -2
- package/lib-es/components/Layout/Layout.js.map +1 -1
- package/lib-es/components/Layout/LayoutFactory.js +14 -0
- package/lib-es/components/Layout/LayoutFactory.js.map +1 -0
- package/lib-es/components/Layout/LayoutWithStickyTimer.js +42 -0
- package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -0
- package/lib-es/components/Layout/index.js +2 -2
- package/lib-es/components/Layout/index.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +12 -16
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/helpers/index.js +0 -2
- package/lib-es/components/List/helpers/index.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContent.js +6 -8
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +11 -18
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +72 -47
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js +0 -2
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-new-query.js +6 -0
- package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js +23 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +26 -0
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/index.js +4 -5
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/SearchFilter/index.js +2 -2
- package/lib-es/components/SearchFilter/index.js.map +1 -1
- package/lib-es/components/SearchFilterSort/SearchFilterSort.js +10 -26
- package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +4 -21
- package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js +4 -8
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib-es/helpers/build-inherited-filters.js +0 -2
- package/lib-es/helpers/build-inherited-filters.js.map +1 -1
- package/lib-es/helpers/build-props-query.js +2 -4
- package/lib-es/helpers/build-props-query.js.map +1 -1
- package/lib-es/helpers/build-set-filters.js +1 -5
- package/lib-es/helpers/build-set-filters.js.map +1 -1
- package/lib-es/helpers/get-query-filters.js +8 -6
- package/lib-es/helpers/get-query-filters.js.map +1 -1
- package/lib-es/helpers/get-query-props.js +2 -10
- package/lib-es/helpers/get-query-props.js.map +1 -1
- package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
- package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib-es/helpers/index.js +0 -2
- package/lib-es/helpers/index.js.map +1 -1
- package/lib-es/helpers/parse-props-to-display.js +9 -12
- package/lib-es/helpers/parse-props-to-display.js.map +1 -1
- package/lib-es/utils/get-class-modifiers.js +1 -1
- package/lib-es/utils/get-class-modifiers.js.map +1 -1
- package/package.json +10 -10
- package/src/HOC/recreateOnNavigation.js +21 -0
- package/src/components/Button.js +1 -2
- package/src/components/Card/CardsContainer.js +3 -3
- package/src/components/Card/CardsRender.js +7 -27
- package/src/components/Card/helpers/index.js +0 -1
- package/src/components/Code/Code.js +3 -7
- package/src/components/ContentGroupSection/ContentGroupSection.js +1 -1
- package/src/components/DataSummary/helpers/build-loop-props-content.js +1 -4
- package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -6
- package/src/components/Layout/Layout.js +29 -32
- package/src/components/Layout/LayoutFactory.js +17 -0
- package/src/components/Layout/LayoutWithStickyTimer.js +40 -0
- package/src/components/Layout/index.js +2 -2
- package/src/components/List/ListFactory.js +15 -25
- package/src/components/List/helpers/index.js +0 -2
- package/src/components/SearchContent/SearchContent.js +6 -8
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +12 -21
- package/src/components/SearchFilter/SearchFilterContainer.js +69 -57
- package/src/components/SearchFilter/helpers/build-filters-query.js +1 -9
- package/src/components/SearchFilter/helpers/build-new-query.js +6 -0
- package/src/components/SearchFilter/helpers/build-query.js +26 -0
- package/src/components/SearchFilter/helpers/get-initial-filter-values.js +30 -0
- package/src/components/SearchFilter/helpers/index.js +7 -9
- package/src/components/SearchFilter/index.js +2 -2
- package/src/components/SearchFilterSort/SearchFilterSort.js +8 -18
- package/src/components/SearchFilterSort/helpers/handle-sort-update.js +5 -14
- package/src/components/SearchFilterSort/helpers/update-sort.js +3 -7
- package/src/helpers/build-inherited-filters.js +1 -3
- package/src/helpers/build-props-query.js +2 -4
- package/src/helpers/build-set-filters.js +1 -2
- package/src/helpers/get-query-filters.js +4 -4
- package/src/helpers/get-query-props.js +4 -12
- package/src/helpers/get-wrapped-value-with-link.js +3 -6
- package/src/helpers/index.js +0 -2
- package/src/helpers/parse-props-to-display.js +21 -25
- package/src/utils/get-class-modifiers.js +1 -1
- package/tests/helpers/mocks.js +5 -3
- package/tests/unit/src/HOC/recreateOnNavigation.test.js +28 -0
- package/tests/unit/src/components/Code/Code.test.js +0 -5
- package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +0 -8
- package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -9
- package/tests/unit/src/components/Layout/Layout.test.js +1 -1
- package/tests/unit/src/components/Layout/LayoutFactory.test.js +53 -0
- package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
- package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +10 -10
- package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +7 -24
- package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +10 -10
- package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +1 -4
- package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +19 -26
- package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +1 -10
- package/tests/unit/src/helpers/build-props-query.test.js +0 -25
- package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
- package/tests/unit/src/helpers/parse-props-to-display.test.js +0 -4
- package/lib/components/Card/helpers/get-updated-items-to-display.js +0 -55
- package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib/components/List/helpers/get-list-query.js +0 -43
- package/lib/components/List/helpers/get-list-query.js.map +0 -1
- package/lib/components/List/helpers/get-list-specific-search-filter.js +0 -21
- package/lib/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
- package/lib/components/List/helpers/strip-query-key.js +0 -14
- package/lib/components/List/helpers/strip-query-key.js.map +0 -1
- package/lib/components/SearchFilter/helpers/build-new-url.js +0 -17
- package/lib/components/SearchFilter/helpers/build-new-url.js.map +0 -1
- package/lib/components/SearchFilter/helpers/build-url-query.js +0 -48
- package/lib/components/SearchFilter/helpers/build-url-query.js.map +0 -1
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -32
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
- package/lib/components/SearchFilter/helpers/get-filter-values.js +0 -31
- package/lib/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
- package/lib/components/SearchFilter/searchFilterReducer.js +0 -45
- package/lib/components/SearchFilter/searchFilterReducer.js.map +0 -1
- package/lib/helpers/build-query-key.js +0 -16
- package/lib/helpers/build-query-key.js.map +0 -1
- package/lib/helpers/process-data-summary-value.js +0 -56
- package/lib/helpers/process-data-summary-value.js.map +0 -1
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js +0 -32
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib-es/components/List/helpers/get-list-query.js +0 -24
- package/lib-es/components/List/helpers/get-list-query.js.map +0 -1
- package/lib-es/components/List/helpers/get-list-specific-search-filter.js +0 -12
- package/lib-es/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
- package/lib-es/components/List/helpers/strip-query-key.js +0 -6
- package/lib-es/components/List/helpers/strip-query-key.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/build-new-url.js +0 -8
- package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/build-url-query.js +0 -30
- package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -18
- package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/get-filter-values.js +0 -19
- package/lib-es/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
- package/lib-es/components/SearchFilter/searchFilterReducer.js +0 -28
- package/lib-es/components/SearchFilter/searchFilterReducer.js.map +0 -1
- package/lib-es/helpers/build-query-key.js +0 -7
- package/lib-es/helpers/build-query-key.js.map +0 -1
- package/lib-es/helpers/process-data-summary-value.js +0 -36
- package/lib-es/helpers/process-data-summary-value.js.map +0 -1
- package/src/components/Card/helpers/get-updated-items-to-display.js +0 -32
- package/src/components/List/helpers/get-list-query.js +0 -28
- package/src/components/List/helpers/get-list-specific-search-filter.js +0 -10
- package/src/components/List/helpers/strip-query-key.js +0 -6
- package/src/components/SearchFilter/helpers/build-new-url.js +0 -8
- package/src/components/SearchFilter/helpers/build-url-query.js +0 -31
- package/src/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -17
- package/src/components/SearchFilter/helpers/get-filter-values.js +0 -21
- package/src/components/SearchFilter/searchFilterReducer.js +0 -15
- package/src/helpers/build-query-key.js +0 -7
- package/src/helpers/process-data-summary-value.js +0 -22
- package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +0 -72
- package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +0 -18
- package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-sort-update.js","names":["stringify","DEFAULT_SORT","SORT","SORTBY","PAGINATION_QUERY","updateSort","handleSortUpdate","router","value","query","url","selectLabel","
|
|
1
|
+
{"version":3,"file":"handle-sort-update.js","names":["stringify","DEFAULT_SORT","SORT","SORTBY","PAGINATION_QUERY","updateSort","handleSortUpdate","router","value","query","url","selectLabel","queryWithoutSort","routerOptions","shallow","scroll","Object","keys","forEach","key","indexOf","stringifiedQuery","push","updatedSortUrl"],"sources":["../../../../src/components/SearchFilterSort/helpers/handle-sort-update.js"],"sourcesContent":["import { stringify } from 'query-string';\nimport { DEFAULT_SORT, SORT, SORTBY, PAGINATION_QUERY } from '../constants';\nimport updateSort from './update-sort';\n\nconst handleSortUpdate = (router, value, query, url, selectLabel) => {\n const queryWithoutSort = {};\n const routerOptions = { shallow: true, scroll: false };\n Object.keys(query).forEach(key => {\n if (key.indexOf(PAGINATION_QUERY) !== -1) return;\n if (key !== SORTBY && key !== SORT) queryWithoutSort[key] = query[key];\n });\n if (value === DEFAULT_SORT || value === selectLabel) {\n const stringifiedQuery = stringify(queryWithoutSort);\n\n return stringifiedQuery\n ? router.push(`/Resolver`, `${url}?${stringifiedQuery}`, routerOptions)\n : router.push(`/Resolver`, url, routerOptions);\n }\n const updatedSortUrl = updateSort(value, queryWithoutSort, url);\n return router.push('/Resolver', updatedSortUrl, routerOptions);\n};\n\nexport default handleSortUpdate;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AACxC,SAASC,YAAY,EAAEC,IAAI,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,cAAc;AAC3E,OAAOC,UAAU,MAAM,eAAe;AAEtC,MAAMC,gBAAgB,GAAGA,CAACC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,GAAG,EAAEC,WAAW,KAAK;EACnE,MAAMC,gBAAgB,GAAG,CAAC,CAAC;EAC3B,MAAMC,aAAa,GAAG;IAAEC,OAAO,EAAE,IAAI;IAAEC,MAAM,EAAE;EAAM,CAAC;EACtDC,MAAM,CAACC,IAAI,CAACR,KAAK,CAAC,CAACS,OAAO,CAACC,GAAG,IAAI;IAChC,IAAIA,GAAG,CAACC,OAAO,CAAChB,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE;IAC1C,IAAIe,GAAG,KAAKhB,MAAM,IAAIgB,GAAG,KAAKjB,IAAI,EAAEU,gBAAgB,CAACO,GAAG,CAAC,GAAGV,KAAK,CAACU,GAAG,CAAC;EACxE,CAAC,CAAC;EACF,IAAIX,KAAK,KAAKP,YAAY,IAAIO,KAAK,KAAKG,WAAW,EAAE;IACnD,MAAMU,gBAAgB,GAAGrB,SAAS,CAACY,gBAAgB,CAAC;IAEpD,OAAOS,gBAAgB,GACnBd,MAAM,CAACe,IAAI,CAAE,WAAU,EAAG,GAAEZ,GAAI,IAAGW,gBAAiB,EAAC,EAAER,aAAa,CAAC,GACrEN,MAAM,CAACe,IAAI,CAAE,WAAU,EAAEZ,GAAG,EAAEG,aAAa,CAAC;EAClD;EACA,MAAMU,cAAc,GAAGlB,UAAU,CAACG,KAAK,EAAEI,gBAAgB,EAAEF,GAAG,CAAC;EAC/D,OAAOH,MAAM,CAACe,IAAI,CAAC,WAAW,EAAEC,cAAc,EAAEV,aAAa,CAAC;AAChE,CAAC;AAED,eAAeP,gBAAgB"}
|
|
@@ -2,18 +2,14 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { stringify } from 'query-string';
|
|
5
|
-
|
|
6
|
-
import { SORT, SORTBY } from '../constants';
|
|
7
|
-
const updateSort = (value, query, url, hashBit = '', listComponentName = '') => {
|
|
8
|
-
const sortKey = buildQueryKey(SORT, listComponentName);
|
|
9
|
-
const sortByKey = buildQueryKey(SORTBY, listComponentName);
|
|
5
|
+
const updateSort = (value, query, url) => {
|
|
10
6
|
const [newSortBy, newSort] = value.split(':');
|
|
11
7
|
const updatedQuery = _objectSpread(_objectSpread({}, query), {}, {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
sortby: newSortBy,
|
|
9
|
+
sort: newSort
|
|
14
10
|
});
|
|
15
11
|
const parsedQuery = stringify(updatedQuery);
|
|
16
|
-
return `${url}?${parsedQuery}
|
|
12
|
+
return `${url}?${parsedQuery}`;
|
|
17
13
|
};
|
|
18
14
|
export default updateSort;
|
|
19
15
|
//# sourceMappingURL=update-sort.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-sort.js","names":["stringify","
|
|
1
|
+
{"version":3,"file":"update-sort.js","names":["stringify","updateSort","value","query","url","newSortBy","newSort","split","updatedQuery","_objectSpread","sortby","sort","parsedQuery"],"sources":["../../../../src/components/SearchFilterSort/helpers/update-sort.js"],"sourcesContent":["import { stringify } from 'query-string';\n\nconst updateSort = (value, query, url) => {\n const [newSortBy, newSort] = value.split(':');\n const updatedQuery = { ...query, sortby: newSortBy, sort: newSort };\n const parsedQuery = stringify(updatedQuery);\n return `${url}?${parsedQuery}`;\n};\n\nexport default updateSort;\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,cAAc;AAExC,MAAMC,UAAU,GAAGA,CAACC,KAAK,EAAEC,KAAK,EAAEC,GAAG,KAAK;EACxC,MAAM,CAACC,SAAS,EAAEC,OAAO,CAAC,GAAGJ,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EAC7C,MAAMC,YAAY,GAAAC,aAAA,CAAAA,aAAA,KAAQN,KAAK;IAAEO,MAAM,EAAEL,SAAS;IAAEM,IAAI,EAAEL;EAAO,EAAE;EACnE,MAAMM,WAAW,GAAGZ,SAAS,CAACQ,YAAY,CAAC;EAC3C,OAAQ,GAAEJ,GAAI,IAAGQ,WAAY,EAAC;AAChC,CAAC;AAED,eAAeX,UAAU"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import flatten from 'lodash.flatten';
|
|
2
2
|
import isFilterEntitysId from './is-filter-entitys-id';
|
|
3
3
|
import getFilterProps from './get-filter-props';
|
|
4
|
-
import { ID } from '../constants';
|
|
5
4
|
const getRelationData = (entityData, relationName, currentRelationNames) => {
|
|
6
5
|
if (!entityData) return null;
|
|
7
6
|
if (currentRelationNames && currentRelationNames.length) {
|
|
@@ -39,7 +38,6 @@ const buildInheritedFilters = (entityData, inheritedFilters, currentSchema, filt
|
|
|
39
38
|
relationForeignKeys,
|
|
40
39
|
shouldIgnoreFilter
|
|
41
40
|
} = getFilterProps(filter, currentSchema, filterEntitySchema);
|
|
42
|
-
if (filterName === ID) return;
|
|
43
41
|
const relationData = getRelationData(entityData, relationName, relationForeignKeys);
|
|
44
42
|
if (currentEntityId === entityName && isFilterEntitysId(filterName, currentEntityId) || shouldIgnoreFilter) {
|
|
45
43
|
relationFilters.push(`${filterName}/${itemId}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-inherited-filters.js","names":["flatten","isFilterEntitysId","getFilterProps","
|
|
1
|
+
{"version":3,"file":"build-inherited-filters.js","names":["flatten","isFilterEntitysId","getFilterProps","getRelationData","entityData","relationName","currentRelationNames","length","arrayOfRelations","map","name","filter","Boolean","checkIfArrayHasData","isDataArray","relationData","setFiltersNoRelation","arrayHasData","filters","filterValues","reduce","acc","relationValue","push","buildInheritedFilters","inheritedFilters","currentSchema","filterEntitySchema","itemId","relationFilters","identifier","currentEntityId","forEach","filterName","entityName","relationProp","relationEntityName","relationForeignKeys","shouldIgnoreFilter","Array","isArray","filtersNoRelation"],"sources":["../../src/helpers/build-inherited-filters.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\n\nconst getRelationData = (entityData, relationName, currentRelationNames) => {\n if (!entityData) return null;\n if (currentRelationNames && currentRelationNames.length) {\n const arrayOfRelations = currentRelationNames.map(name => entityData[name]).filter(Boolean);\n return arrayOfRelations.length ? flatten(arrayOfRelations) : null;\n }\n return entityData[relationName];\n};\n\nconst checkIfArrayHasData = (isDataArray, relationData) => isDataArray && !!relationData.length;\n\nconst setFiltersNoRelation = (isDataArray, arrayHasData, relationData, relationName) => {\n const filters = [];\n if (arrayHasData) {\n const filterValues = relationData.reduce((acc, relationValue) => {\n if (relationValue && typeof relationValue !== 'object')\n acc.push(`${relationName}/${relationValue}`);\n return acc;\n }, []);\n filters.push(...filterValues);\n } else if (!isDataArray && typeof relationData !== 'object') {\n filters.push(`${relationName}/${relationData}`);\n }\n\n return filters;\n};\nconst buildInheritedFilters = (\n entityData,\n inheritedFilters,\n currentSchema,\n filterEntitySchema,\n itemId\n) => {\n const relationFilters = [];\n const { identifier: currentEntityId } = currentSchema;\n\n inheritedFilters.forEach(filter => {\n const {\n filterName,\n entityName,\n relationName,\n relationProp,\n relationEntityName,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n const relationData = getRelationData(entityData, relationName, relationForeignKeys);\n\n if (\n (currentEntityId === entityName && isFilterEntitysId(filterName, currentEntityId)) ||\n shouldIgnoreFilter\n ) {\n relationFilters.push(`${filterName}/${itemId}`);\n }\n\n if (!relationData) return;\n\n const isDataArray = Array.isArray(relationData);\n const arrayHasData = checkIfArrayHasData(isDataArray, relationData);\n\n if (!relationEntityName) {\n const filtersNoRelation = setFiltersNoRelation(\n isDataArray,\n arrayHasData,\n relationData,\n relationName\n );\n relationFilters.push(...filtersNoRelation);\n }\n\n if (arrayHasData) {\n const filterValues = relationData.reduce((acc, relationValue) => {\n if (relationValue[relationProp]) acc.push(`${filterName}/${relationValue[relationProp]}`);\n return acc;\n }, []);\n relationFilters.push(...filterValues);\n } else if (!isDataArray && relationData[relationProp]) {\n relationFilters.push(`${filterName}/${relationData[relationProp]}`);\n }\n });\n\n return relationFilters;\n};\n\nexport default buildInheritedFilters;\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,gBAAgB;AACpC,OAAO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AGX,aAAa,CAACa,YAAY,CAAE,EAAC,CAAC;QACzF,OAAOd,GAAG;MACZ,CAAC,EAAE,EAAE,CAAC;MACNQ,eAAe,CAACN,IAAI,CAAC,GAAGJ,YAAY,CAAC;IACvC,CAAC,MAAM,IAAI,CAACL,WAAW,IAAIC,YAAY,CAACoB,YAAY,CAAC,EAAE;MACrDN,eAAe,CAACN,IAAI,CAAE,GAAEU,UAAW,IAAGlB,YAAY,CAACoB,YAAY,CAAE,EAAC,CAAC;IACrE;EACF,CAAC,CAAC;EAEF,OAAON,eAAe;AACxB,CAAC;AAED,eAAeL,qBAAqB"}
|
|
@@ -28,18 +28,16 @@ const buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, link
|
|
|
28
28
|
};
|
|
29
29
|
const buildComplexProps = (shouldAddCategoryProps, props, {
|
|
30
30
|
relations = [],
|
|
31
|
-
dynamicProperties = {}
|
|
32
|
-
properties = {}
|
|
31
|
+
dynamicProperties = {}
|
|
33
32
|
}, linkProps) => Object.keys(props).map(base => {
|
|
34
33
|
const nestedProps = props[base];
|
|
35
34
|
const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));
|
|
36
|
-
const matchingProperty = !!properties[base];
|
|
37
35
|
const matchingRelation = relations.find(({
|
|
38
36
|
localField
|
|
39
37
|
}) => localField === base);
|
|
40
38
|
const matchingDynamicProp = Object.keys(dynamicProperties).find(dynamicKey => dynamicKey === base);
|
|
41
39
|
if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');
|
|
42
|
-
if (hasLink && (!!
|
|
40
|
+
if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
|
|
43
41
|
const jointNestedProps = nestedProps.join(',');
|
|
44
42
|
if (base === 'category' && shouldAddCategoryProps) return `${base}{${jointNestedProps}, ${categoryProps}}`;
|
|
45
43
|
if (base.includes('published')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-props-query.js","names":["CATEGORY_ID","ID","PREHEADER_PROP","HEADLINE_PROP","defaultProps","categoryProps","checkProps","props","Object","keys","filter","prop","length","buildPropsQuery","entitySchema","extraProps","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","typeBasedProps","shouldAddCategoryProps","getTypeBaseProps","allProps","uniqueProps","Set","basicProps","nestedProps","forEach","push","base","nested","split","complexProps","buildComplexProps","join","relations","dynamicProperties","
|
|
1
|
+
{"version":3,"file":"build-props-query.js","names":["CATEGORY_ID","ID","PREHEADER_PROP","HEADLINE_PROP","defaultProps","categoryProps","checkProps","props","Object","keys","filter","prop","length","buildPropsQuery","entitySchema","extraProps","cardOptions","linkProps","parsedSchema","getEntitySchema","extraPropsHaveCategory","includes","typeBasedProps","shouldAddCategoryProps","getTypeBaseProps","allProps","uniqueProps","Set","basicProps","nestedProps","forEach","push","base","nested","split","complexProps","buildComplexProps","join","relations","dynamicProperties","map","hasLink","find","linkProp","matchingRelation","localField","matchingDynamicProp","dynamicKey","jointNestedProps","isCard","displayCategory","displayThumbnail","interfaces","properties","isContent","hasCategory","hasPreheader","getCategoyProps","getContentProps","url"],"sources":["../../src/helpers/build-props-query.js"],"sourcesContent":["import { CATEGORY_ID, ID, PREHEADER_PROP, HEADLINE_PROP } from '../constants';\n\nconst defaultProps = [ID, 'name'];\nconst categoryProps = 'id publishedListingPage{id, url}';\n\nconst checkProps = props =>\n !!(props && Object.keys(props).filter(prop => prop === CATEGORY_ID).length);\n\nconst buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, linkProps = []) => {\n const parsedSchema = entitySchema.getEntitySchema ? entitySchema.getEntitySchema : entitySchema;\n const extraPropsHaveCategory = !!extraProps.filter(prop => prop.includes('category.')).length;\n const { typeBasedProps, shouldAddCategoryProps } = getTypeBaseProps(\n parsedSchema,\n cardOptions,\n extraPropsHaveCategory\n );\n\n const allProps = [...typeBasedProps, ...extraProps];\n const uniqueProps = [...new Set([...allProps])];\n const basicProps = [];\n const nestedProps = {};\n uniqueProps.forEach(prop => {\n if (prop) {\n if (!prop.includes('.')) {\n basicProps.push(prop);\n return;\n }\n const [base, nested] = prop.split('.');\n if (!nestedProps[base]) nestedProps[base] = [nested];\n else nestedProps[base].push(nested);\n }\n });\n\n const complexProps = buildComplexProps(\n shouldAddCategoryProps,\n nestedProps,\n parsedSchema,\n linkProps\n );\n\n return [...basicProps, ...complexProps].join(',');\n};\n\nconst buildComplexProps = (\n shouldAddCategoryProps,\n props,\n { relations = [], dynamicProperties = {} },\n linkProps\n) =>\n Object.keys(props).map(base => {\n const nestedProps = props[base];\n const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));\n const matchingRelation = relations.find(({ localField }) => localField === base);\n const matchingDynamicProp = Object.keys(dynamicProperties).find(\n dynamicKey => dynamicKey === base\n );\n\n if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');\n if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');\n const jointNestedProps = nestedProps.join(',');\n if (base === 'category' && shouldAddCategoryProps)\n return `${base}{${jointNestedProps}, ${categoryProps}}`;\n if (base.includes('published')) {\n return `${base}{${jointNestedProps},url}`;\n }\n return `${base}{${jointNestedProps}}`;\n });\n\nconst getTypeBaseProps = (entitySchema, cardOptions, extraPropsHaveCategory) => {\n const isCard = !!cardOptions;\n const { displayCategory = true, displayThumbnail = true } = cardOptions || {};\n\n const shouldAddCategoryProps =\n (isCard && displayCategory) || (!isCard && !extraPropsHaveCategory);\n\n if (!isCard) return { typeBasedProps: [ID], shouldAddCategoryProps };\n\n const { interfaces, properties, dynamicProperties, relations } = entitySchema;\n\n const isContent = !!interfaces.includes('content/content');\n const hasCategory = checkProps(properties) || checkProps(dynamicProperties);\n const hasPreheader = properties[PREHEADER_PROP];\n\n const typeBasedProps = [...defaultProps];\n\n typeBasedProps.push(...getCategoyProps(shouldAddCategoryProps, hasCategory, hasPreheader));\n typeBasedProps.push(...getContentProps(isContent));\n\n if (properties.url || dynamicProperties.url) typeBasedProps.push('url');\n\n if (displayThumbnail && relations.find(({ localField }) => localField === 'image')) {\n typeBasedProps.push('image.id', 'image.url', 'image.data');\n }\n\n return { typeBasedProps, shouldAddCategoryProps };\n};\n\nconst getContentProps = isContent => (isContent ? ['url', 'sponsored', 'featured'] : []);\n\nconst getCategoyProps = (shouldAddCategoryProps, hasCategory, hasPreheader) => {\n if (!shouldAddCategoryProps) return [];\n const props = [];\n if (hasCategory)\n props.push('category.name', 'category.listingPageId', 'category.listingPageEntity');\n\n if (hasPreheader) {\n props.push(`${PREHEADER_PROP}{name}`);\n props.push(HEADLINE_PROP);\n }\n\n return props;\n};\n\nexport default buildPropsQuery;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,EAAE,EAAEC,cAAc,EAAEC,aAAa,QAAQ,cAAc;AAE7E,MAAMC,YAAY,GAAG,CAACH,EAAE,EAAE,MAAM,CAAC;AACjC,MAAMI,aAAa,GAAG,kCAAkC;AAExD,MAAMC,UAAU,GAAGC,KAAK,IACtB,CAAC,EAAEA,KAAK,IAAIC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAACG,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAKX,WAAW,CAAC,CAACY,MAAM,CAAC;AAE7E,MAAMC,eAAe,GAAGA,CAACC,YAAY,EAAEC,UAAU,GAAG,EAAE,EAAEC,WAAW,GAAG,IAAI,EAAEC,SAAS,GAAG,EAAE,KAAK;EAC7F,MAAMC,YAAY,GAAGJ,YAAY,CAACK,eAAe,GAAGL,YAAY,CAACK,eAAe,GAAGL,YAAY;EAC/F,MAAMM,sBAAsB,GAAG,CAAC,CAACL,UAAU,CAACL,MAAM,CAACC,IAAI,IAAIA,IAAI,CAACU,QAAQ,CAAC,WAAW,CAAC,CAAC,CAACT,MAAM;EAC7F,MAAM;IAAEU,cAAc;IAAEC;EAAuB,CAAC,GAAGC,gBAAgB,CACjEN,YAAY,EACZF,WAAW,EACXI,sBACF,CAAC;EAED,MAAMK,QAAQ,GAAG,CAAC,GAAGH,cAAc,EAAE,GA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AACwB,IAAI,CAAC,eAAe,EAAE,wBAAwB,EAAE,4BAA4B,CAAC;EAErF,IAAIyB,YAAY,EAAE;IAChBjD,KAAK,CAACwB,IAAI,CAAE,GAAE7B,cAAe,QAAO,CAAC;IACrCK,KAAK,CAACwB,IAAI,CAAC5B,aAAa,CAAC;EAC3B;EAEA,OAAOI,KAAK;AACd,CAAC;AAED,eAAeM,eAAe"}
|
|
@@ -24,11 +24,7 @@ const buildSetFilters = ({
|
|
|
24
24
|
getCheckboxFilters(checkboxFilters, SPONSORED);
|
|
25
25
|
}
|
|
26
26
|
const shouldApplyFilterValues = filterBy.length && filterByProperty.length;
|
|
27
|
-
|
|
28
|
-
checkboxFilters,
|
|
29
|
-
listFilterValues: {}
|
|
30
|
-
};
|
|
31
|
-
const listFilterValues = getFilterValues(filterBy);
|
|
27
|
+
const listFilterValues = shouldApplyFilterValues ? getFilterValues(filterBy) : {};
|
|
32
28
|
return {
|
|
33
29
|
checkboxFilters,
|
|
34
30
|
listFilterValues
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-set-filters.js","names":["FEATURED","SPONSORED","getCheckboxFilters","checkboxFilters","name","push","getFilterValues","filterBy","reduce","acc","filter","fieldName","values","split","value","join","previousValue","finalValue","buildSetFilters","filterByProperty","filterByFeatured","filterBySponsored","shouldApplyFilterValues","length","listFilterValues"],"sources":["../../src/helpers/build-set-filters.js"],"sourcesContent":["import { FEATURED, SPONSORED } from '../constants';\n\nconst getCheckboxFilters = (checkboxFilters, name) => {\n checkboxFilters.push(name);\n};\n\nconst getFilterValues = filterBy =>\n filterBy.reduce((acc, filter) => {\n const [fieldName, ...values] = filter.split('/');\n const value = values.join('/');\n const previousValue = acc[fieldName];\n const finalValue = previousValue ? [...previousValue, value] : [value];\n\n acc[fieldName] = finalValue;\n return acc;\n }, {});\n\nconst buildSetFilters = ({\n filterBy = [],\n filterByProperty = [],\n filterByFeatured,\n filterBySponsored\n}) => {\n const checkboxFilters = [];\n\n if (filterByFeatured) {\n getCheckboxFilters(checkboxFilters, FEATURED);\n }\n if (filterBySponsored) {\n getCheckboxFilters(checkboxFilters, SPONSORED);\n }\n\n const shouldApplyFilterValues = filterBy.length && filterByProperty.length;\n
|
|
1
|
+
{"version":3,"file":"build-set-filters.js","names":["FEATURED","SPONSORED","getCheckboxFilters","checkboxFilters","name","push","getFilterValues","filterBy","reduce","acc","filter","fieldName","values","split","value","join","previousValue","finalValue","buildSetFilters","filterByProperty","filterByFeatured","filterBySponsored","shouldApplyFilterValues","length","listFilterValues"],"sources":["../../src/helpers/build-set-filters.js"],"sourcesContent":["import { FEATURED, SPONSORED } from '../constants';\n\nconst getCheckboxFilters = (checkboxFilters, name) => {\n checkboxFilters.push(name);\n};\n\nconst getFilterValues = filterBy =>\n filterBy.reduce((acc, filter) => {\n const [fieldName, ...values] = filter.split('/');\n const value = values.join('/');\n const previousValue = acc[fieldName];\n const finalValue = previousValue ? [...previousValue, value] : [value];\n\n acc[fieldName] = finalValue;\n return acc;\n }, {});\n\nconst buildSetFilters = ({\n filterBy = [],\n filterByProperty = [],\n filterByFeatured,\n filterBySponsored\n}) => {\n const checkboxFilters = [];\n\n if (filterByFeatured) {\n getCheckboxFilters(checkboxFilters, FEATURED);\n }\n if (filterBySponsored) {\n getCheckboxFilters(checkboxFilters, SPONSORED);\n }\n\n const shouldApplyFilterValues = filterBy.length && filterByProperty.length;\n const listFilterValues = shouldApplyFilterValues ? getFilterValues(filterBy) : {};\n\n return { checkboxFilters, listFilterValues };\n};\n\nexport default buildSetFilters;\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,cAAc;AAElD,MAAMC,kBAAkB,GAAGA,CAACC,eAAe,EAAEC,IAAI,KAAK;EACpDD,eAAe,CAACE,IAAI,CAACD,IAAI,CAAC;AAC5B,CAAC;AAED,MAAME,eAAe,GAAGC,QAAQ,IAC9BA,QAAQ,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAK;EAC/B,MAAM,CAACC,SAAS,EAAE,GAAGC,MAAM,CAAC,GAAGF,MAAM,CAACG,KAAK,CAAC,GAAG,CAAC;EAChD,MAAMC,KAAK,GAAGF,MAAM,CAACG,IAAI,CAAC,GAAG,CAAC;EAC9B,MAAMC,aAAa,GAAGP,GAAG,CAACE,SAAS,CAAC;EACpC,MAAMM,UAAU,GAAGD,aAAa,GAAG,CAAC,GAAGA,aAAa,EAAEF,KAAK,CAAC,GAAG,CAACA,KAAK,CAAC;EAEtEL,GAAG,CAACE,SAAS,CAAC,GAAGM,UAAU;EAC3B,OAAOR,GAAG;AACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AAER,MAAMS,eAAe,GAAGA,CAAC;EACvBX,QAAQ,GAAG,EAAE;EACbY,gBAAgB,GAAG,EAAE;EACrBC,gBAAgB;EAChBC;AACF,CAAC,KAAK;EACJ,MAAMlB,eAAe,GAAG,EAAE;EAE1B,IAAIiB,gBAAgB,EAAE;IACpBlB,kBAAkB,CAACC,eAAe,EAAEH,QAAQ,CAAC;EAC/C;EACA,IAAIqB,iBAAiB,EAAE;IACrBnB,kBAAkB,CAACC,eAAe,EAAEF,SAAS,CAAC;EAChD;EAEA,MAAMqB,uBAAuB,GAAGf,QAAQ,CAACgB,MAAM,IAAIJ,gBAAgB,CAACI,MAAM;EAC1E,MAAMC,gBAAgB,GAAGF,uBAAuB,GAAGhB,eAAe,CAACC,QAAQ,CAAC,GAAG,CAAC,CAAC;EAEjF,OAAO;IAAEJ,eAAe;IAAEqB;EAAiB,CAAC;AAC9C,CAAC;AAED,eAAeN,eAAe"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import getSearchFilterType from './get-search-filter-type';
|
|
2
2
|
import buildSearchValuesCheckboxSelect from './build-search-values-checkbox-select';
|
|
3
3
|
import { RANGE, CHECKBOX, SELECT } from '../constants';
|
|
4
|
-
const getQueryFilters = (searchFilter, query
|
|
5
|
-
if (!searchFilter.settings || !searchFilter.settings.filters)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const getQueryFilters = (searchFilter, query) => {
|
|
5
|
+
if (!searchFilter.settings || !searchFilter.settings.filters) {
|
|
6
|
+
return {
|
|
7
|
+
valuesAnd: [],
|
|
8
|
+
valuesOr: []
|
|
9
|
+
};
|
|
10
|
+
}
|
|
9
11
|
const rangeFilters = getSearchFilterType(searchFilter, RANGE);
|
|
10
12
|
const checkboxFilters = getSearchFilterType(searchFilter, CHECKBOX);
|
|
11
13
|
const selectFilters = getSearchFilterType(searchFilter, SELECT);
|
|
12
14
|
const {
|
|
13
15
|
values: valuesAnd,
|
|
14
16
|
valuesOr
|
|
15
|
-
} = buildSearchValuesCheckboxSelect(query, rangeFilters, checkboxFilters, selectFilters
|
|
17
|
+
} = buildSearchValuesCheckboxSelect(query, rangeFilters, checkboxFilters, selectFilters);
|
|
16
18
|
return {
|
|
17
19
|
valuesAnd,
|
|
18
20
|
valuesOr
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-query-filters.js","names":["getSearchFilterType","buildSearchValuesCheckboxSelect","RANGE","CHECKBOX","SELECT","getQueryFilters","searchFilter","query","
|
|
1
|
+
{"version":3,"file":"get-query-filters.js","names":["getSearchFilterType","buildSearchValuesCheckboxSelect","RANGE","CHECKBOX","SELECT","getQueryFilters","searchFilter","query","settings","filters","valuesAnd","valuesOr","rangeFilters","checkboxFilters","selectFilters","values"],"sources":["../../src/helpers/get-query-filters.js"],"sourcesContent":["import getSearchFilterType from './get-search-filter-type';\nimport buildSearchValuesCheckboxSelect from './build-search-values-checkbox-select';\nimport { RANGE, CHECKBOX, SELECT } from '../constants';\n\nconst getQueryFilters = (searchFilter, query) => {\n if (!searchFilter.settings || !searchFilter.settings.filters) {\n return { valuesAnd: [], valuesOr: [] };\n }\n\n const rangeFilters = getSearchFilterType(searchFilter, RANGE);\n const checkboxFilters = getSearchFilterType(searchFilter, CHECKBOX);\n const selectFilters = getSearchFilterType(searchFilter, SELECT);\n\n const { values: valuesAnd, valuesOr } = buildSearchValuesCheckboxSelect(\n query,\n rangeFilters,\n checkboxFilters,\n selectFilters\n );\n return { valuesAnd, valuesOr };\n};\n\nexport default getQueryFilters;\n"],"mappings":"AAAA,OAAOA,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,+BAA+B,MAAM,uCAAuC;AACnF,SAASC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,cAAc;AAEtD,MAAMC,eAAe,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EAC/C,IAAI,CAACD,YAAY,CAACE,QAAQ,IAAI,CAACF,YAAY,CAACE,QAAQ,CAACC,OAAO,EAAE;IAC5D,OAAO;MAAEC,SAAS,EAAE,EAAE;MAAEC,QAAQ,EAAE;IAAG,CAAC;EACxC;EAEA,MAAMC,YAAY,GAAGZ,mBAAmB,CAACM,YAAY,EAAEJ,KAAK,CAAC;EAC7D,MAAMW,eAAe,GAAGb,mBAAmB,CAACM,YAAY,EAAEH,QAAQ,CAAC;EACnE,MAAMW,aAAa,GAAGd,mBAAmB,CAACM,YAAY,EAAEF,MAAM,CAAC;EAE/D,MAAM;IAAEW,MAAM,EAAEL,SAAS;IAAEC;EAAS,CAAC,GAAGV,+BAA+B,CACrEM,KAAK,EACLK,YAAY,EACZC,eAAe,EACfC,aACF,CAAC;EACD,OAAO;IAAEJ,SAAS;IAAEC;EAAS,CAAC;AAChC,CAAC;AAED,eAAeN,eAAe"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import isFilterEntitysId from './is-filter-entitys-id';
|
|
2
2
|
import getFilterProps from './get-filter-props';
|
|
3
3
|
import { ID } from '../constants';
|
|
4
|
-
const getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema
|
|
4
|
+
const getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema) => {
|
|
5
5
|
if (!currentSchema || !inheritedFilters.length) return ID;
|
|
6
6
|
const {
|
|
7
|
-
identifier: currentEntityId
|
|
8
|
-
properties
|
|
7
|
+
identifier: currentEntityId
|
|
9
8
|
} = currentSchema;
|
|
10
|
-
const {
|
|
11
|
-
identifier: filterEntityId
|
|
12
|
-
} = filterEntitySchema;
|
|
13
9
|
return inheritedFilters.reduce((acc, filter) => {
|
|
14
10
|
const {
|
|
15
11
|
filterName,
|
|
@@ -24,10 +20,6 @@ const getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema = {})
|
|
|
24
20
|
if (relationForeignKeys && relationForeignKeys.length) {
|
|
25
21
|
return `${acc} ${relationForeignKeys.join(' ')}`;
|
|
26
22
|
}
|
|
27
|
-
if (filterName === ID) {
|
|
28
|
-
const queryValue = Object.keys(properties).find(propKey => properties[propKey] && properties[propKey].relation && properties[propKey].relation.entityIdentifier === filterEntityId);
|
|
29
|
-
if (queryValue) return `${acc} ${queryValue} `;
|
|
30
|
-
}
|
|
31
23
|
const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;
|
|
32
24
|
const queryPropFinalValue = isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;
|
|
33
25
|
return `${acc} ${queryPropFinalValue} `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-query-props.js","names":["isFilterEntitysId","getFilterProps","ID","getQueryProps","inheritedFilters","currentSchema","filterEntitySchema","length","identifier","currentEntityId","
|
|
1
|
+
{"version":3,"file":"get-query-props.js","names":["isFilterEntitysId","getFilterProps","ID","getQueryProps","inheritedFilters","currentSchema","filterEntitySchema","length","identifier","currentEntityId","reduce","acc","filter","filterName","relationName","relationProp","relationEntityName","isEntityItself","relationForeignKeys","shouldIgnoreFilter","join","queryProp","queryPropFinalValue"],"sources":["../../src/helpers/get-query-props.js"],"sourcesContent":["import isFilterEntitysId from './is-filter-entitys-id';\nimport getFilterProps from './get-filter-props';\nimport { ID } from '../constants';\n\nconst getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema) => {\n if (!currentSchema || !inheritedFilters.length) return ID;\n\n const { identifier: currentEntityId } = currentSchema;\n\n return inheritedFilters.reduce((acc, filter) => {\n const {\n filterName,\n relationName,\n relationProp,\n relationEntityName,\n isEntityItself,\n relationForeignKeys,\n shouldIgnoreFilter\n } = getFilterProps(filter, currentSchema, filterEntitySchema);\n\n if (shouldIgnoreFilter) return acc;\n if (relationForeignKeys && relationForeignKeys.length) {\n return `${acc} ${relationForeignKeys.join(' ')}`;\n }\n\n const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;\n const queryPropFinalValue =\n isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;\n\n return `${acc} ${queryPropFinalValue} `;\n }, ID);\n};\n\nexport default getQueryProps;\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,EAAE,QAAQ,cAAc;AAEjC,MAAMC,aAAa,GAAGA,CAACC,gBAAgB,EAAEC,aAAa,EAAEC,kBAAkB,KAAK;EAC7E,IAAI,CAACD,aAAa,IAAI,CAACD,gBAAgB,CAACG,MAAM,EAAE,OAAOL,EAAE;EAEzD,MAAM;IAAEM,UAAU,EAAEC;EAAgB,CAAC,GAAGJ,aAAa;EAErD,OAAOD,gBAAgB,CAACM,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAK;IAC9C,MAAM;MACJC,UAAU;MACVC,YAAY;MACZC,YAAY;MACZC,kBAAkB;MAClBC,cAAc;MACdC,mBAAmB;MACnBC;IACF,CAAC,GAAGlB,cAAc,CAACW,MAAM,EAAEP,aAAa,EAAEC,kBAAkB,CAAC;IAE7D,IAAIa,kBAAkB,EAAE,OAAOR,GAAG;IAClC,IAAIO,mBAAmB,IAAIA,mBAAmB,CAACX,MAAM,EAAE;MACrD,OAAQ,GAAEI,GAAI,IAAGO,mBAAmB,CAACE,IAAI,CAAC,GAAG,CAAE,EAAC;IAClD;IAEA,MAAMC,SAAS,GAAGL,kBAAkB,GAAI,GAAEF,YAAa,MAAKC,YAAa,IAAG,GAAGF,UAAU;IACzF,MAAMS,mBAAmB,GACvBL,cAAc,IAAIjB,iBAAiB,CAACa,UAAU,EAAEJ,eAAe,CAAC,GAAGP,EAAE,GAAGmB,SAAS;IAEnF,OAAQ,GAAEV,GAAI,IAAGW,mBAAoB,GAAE;EACzC,CAAC,EAAEpB,EAAE,CAAC;AACR,CAAC;AAED,eAAeC,aAAa"}
|
|
@@ -9,11 +9,11 @@ const getWrappedValueWithLink = (value, link, keyPrefix = '') => {
|
|
|
9
9
|
} = arrValue;
|
|
10
10
|
const keyValue = arrValue[keyField];
|
|
11
11
|
const isLastItem = index === value.length - 1;
|
|
12
|
-
const keyFieldValue = isLastItem ? keyValue :
|
|
12
|
+
const keyFieldValue = isLastItem ? keyValue : keyValue.concat(',');
|
|
13
13
|
return url ? /*#__PURE__*/React.createElement(BlazeLink, {
|
|
14
14
|
key: [keyPrefix, index].join('-'),
|
|
15
15
|
href: url
|
|
16
|
-
},
|
|
16
|
+
}, `${keyFieldValue} `) : `${keyFieldValue} `;
|
|
17
17
|
});
|
|
18
18
|
return arrayResults.length ? arrayResults : null;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-wrapped-value-with-link.js","names":["React","BlazeLink","getWrappedValueWithLink","value","link","keyPrefix","Array","isArray","arrayResults","map","arrValue","index","keyField","url","keyValue","isLastItem","length","keyFieldValue","
|
|
1
|
+
{"version":3,"file":"get-wrapped-value-with-link.js","names":["React","BlazeLink","getWrappedValueWithLink","value","link","keyPrefix","Array","isArray","arrayResults","map","arrValue","index","keyField","url","keyValue","isLastItem","length","keyFieldValue","concat","createElement","key","join","href"],"sources":["../../src/helpers/get-wrapped-value-with-link.js"],"sourcesContent":["import React from 'react';\nimport BlazeLink from '../components/BlazeLink';\n\nconst getWrappedValueWithLink = (value, link, keyPrefix = '') => {\n if (Array.isArray(value)) {\n const arrayResults = value.map((arrValue, index) => {\n const { keyField, url } = arrValue;\n const keyValue = arrValue[keyField];\n const isLastItem = index === value.length - 1;\n const keyFieldValue = isLastItem ? keyValue : keyValue.concat(',');\n\n return url ? (\n <BlazeLink key={[keyPrefix, index].join('-')} href={url}>{`${keyFieldValue} `}</BlazeLink>\n ) : (\n `${keyFieldValue} `\n );\n });\n\n return arrayResults.length ? arrayResults : null;\n }\n\n return link ? <BlazeLink href={link}>{value}</BlazeLink> : value;\n};\n\nexport default getWrappedValueWithLink;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,yBAAyB;AAE/C,MAAMC,uBAAuB,GAAGA,CAACC,KAAK,EAAEC,IAAI,EAAEC,SAAS,GAAG,EAAE,KAAK;EAC/D,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;IACxB,MAAMK,YAAY,GAAGL,KAAK,CAACM,GAAG,CAAC,CAACC,QAAQ,EAAEC,KAAK,KAAK;MAClD,MAAM;QAAEC,QAAQ;QAAEC;MAAI,CAAC,GAAGH,QAAQ;MAClC,MAAMI,QAAQ,GAAGJ,QAAQ,CAACE,QAAQ,CAAC;MACnC,MAAMG,UAAU,GAAGJ,KAAK,KAAKR,KAAK,CAACa,MAAM,GAAG,CAAC;MAC7C,MAAMC,aAAa,GAAGF,UAAU,GAAGD,QAAQ,GAAGA,QAAQ,CAACI,MAAM,CAAC,GAAG,CAAC;MAElE,OAAOL,GAAG,gBACRb,KAAA,CAAAmB,aAAA,CAAClB,SAAS;QAACmB,GAAG,EAAE,CAACf,SAAS,EAAEM,KAAK,CAAC,CAACU,IAAI,CAAC,GAAG,CAAE;QAACC,IAAI,EAAET;MAAI,GAAG,GAAEI,aAAc,GAAc,CAAC,GAEzF,GAAEA,aAAc,GAClB;IACH,CAAC,CAAC;IAEF,OAAOT,YAAY,CAACQ,MAAM,GAAGR,YAAY,GAAG,IAAI;EAClD;EAEA,OAAOJ,IAAI,gBAAGJ,KAAA,CAAAmB,aAAA,CAAClB,SAAS;IAACqB,IAAI,EAAElB;EAAK,GAAED,KAAiB,CAAC,GAAGA,KAAK;AAClE,CAAC;AAED,eAAeD,uBAAuB"}
|
package/lib-es/helpers/index.js
CHANGED
|
@@ -51,6 +51,4 @@ export { default as getParsedPropValues } from './get-parsed-prop-values';
|
|
|
51
51
|
export { default as getSanitizedPropValues } from './get-sanitized-prop-values';
|
|
52
52
|
export { default as appendImages } from './append-images';
|
|
53
53
|
export { default as parseTextBlock } from './parse-TextBlock';
|
|
54
|
-
export { default as processDataSummaryValue } from './process-data-summary-value';
|
|
55
|
-
export { default as buildQueryKey } from './build-query-key';
|
|
56
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","buildInheritedFilters","buildLinkExtraProps","buildPropsQuery","buildQueryFields","buildRawQuery","buildRawQueryBase","buildSearchValuesCheckboxSelect","buildSearchValuesText","buildSetFilters","checkPropsToUse","getElasticsearchOperator","getClickWrapperOptions","getEntitiesWithBanner","getEntityData","getEntityRenderProps","getGenericProps","getGenericRenderVariables","getImageIds","getInheritedFilters","getModifiers","getNotEqualQuery","getPaginationIndex","getParsedSummaryValue","getQueryFilters","getQueryProps","getRequiredSchemas","getSearchFilterType","getUnpublishedEntityName","getWrappedValueWithLink","getItemsToDisplayIds","isBrowser","isFilterEntitysId","isObject","isUsingRelationImage","parsePropsToDisplay","renderChildren","shouldRenderWaypoint","shouldShowProperty","sortResponseData","splitChildren","getCurrentOffset","updateChildrensParent","getDisplayCountData","buildImageProperties","getUpdatedFilterBy","checkForError","removeUnwantedCharacters","hasChildren","removeExtraItems","getParsedPropValues","getSanitizedPropValues","appendImages","parseTextBlock"
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","buildInheritedFilters","buildLinkExtraProps","buildPropsQuery","buildQueryFields","buildRawQuery","buildRawQueryBase","buildSearchValuesCheckboxSelect","buildSearchValuesText","buildSetFilters","checkPropsToUse","getElasticsearchOperator","getClickWrapperOptions","getEntitiesWithBanner","getEntityData","getEntityRenderProps","getGenericProps","getGenericRenderVariables","getImageIds","getInheritedFilters","getModifiers","getNotEqualQuery","getPaginationIndex","getParsedSummaryValue","getQueryFilters","getQueryProps","getRequiredSchemas","getSearchFilterType","getUnpublishedEntityName","getWrappedValueWithLink","getItemsToDisplayIds","isBrowser","isFilterEntitysId","isObject","isUsingRelationImage","parsePropsToDisplay","renderChildren","shouldRenderWaypoint","shouldShowProperty","sortResponseData","splitChildren","getCurrentOffset","updateChildrensParent","getDisplayCountData","buildImageProperties","getUpdatedFilterBy","checkForError","removeUnwantedCharacters","hasChildren","removeExtraItems","getParsedPropValues","getSanitizedPropValues","appendImages","parseTextBlock"],"sources":["../../src/helpers/index.js"],"sourcesContent":["export { default as buildInheritedFilters } from './build-inherited-filters';\nexport { default as buildLinkExtraProps } from './build-link-extra-props';\nexport { default as buildPropsQuery } from './build-props-query';\nexport { default as buildQueryFields } from './build-query-fields';\nexport { default as buildRawQuery } from './build-raw-query';\nexport { default as buildRawQueryBase } from './build-raw-query-base';\nexport { default as buildSearchValuesCheckboxSelect } from './build-search-values-checkbox-select';\nexport { default as buildSearchValuesText } from './build-search-values-text';\nexport { default as buildSetFilters } from './build-set-filters';\nexport { default as checkPropsToUse } from './check-props-to-use';\nexport { default as getElasticsearchOperator } from './get-elasticsearch-operator';\nexport { default as getClickWrapperOptions } from './get-click-wrapper-options';\nexport { default as getEntitiesWithBanner } from './get-entities-with-banner';\nexport { default as getEntityData } from './get-entity-data';\nexport { default as getEntityRenderProps } from './get-entity-render-props';\nexport { default as getGenericProps } from './get-generic-props';\nexport { default as getGenericRenderVariables } from './get-generic-render-variables';\nexport { default as getImageIds } from './get-image-ids';\nexport { default as getInheritedFilters } from './get-inherited-filters';\nexport { default as getModifiers } from './get-modifiers';\nexport { default as getNotEqualQuery } from './get-not-equal-query';\nexport { default as getPaginationIndex } from './get-pagination-index';\nexport { default as getParsedSummaryValue } from './get-parsed-summary-value';\nexport { default as getQueryFilters } from './get-query-filters';\nexport { default as getQueryProps } from './get-query-props';\nexport { default as getRequiredSchemas } from './get-required-schemas';\nexport { default as getSearchFilterType } from './get-search-filter-type';\nexport { default as getUnpublishedEntityName } from './get-unpublished-entity-name';\nexport { default as getWrappedValueWithLink } from './get-wrapped-value-with-link';\nexport { default as getItemsToDisplayIds } from './get-items-to-display-ids';\nexport { default as isBrowser } from './is-browser';\nexport { default as isFilterEntitysId } from './is-filter-entitys-id';\nexport { default as isObject } from './is-object';\nexport { default as isUsingRelationImage } from './is-using-relation-image';\nexport { default as parsePropsToDisplay } from './parse-props-to-display';\nexport { default as renderChildren } from './render-children';\nexport { default as shouldRenderWaypoint } from './should-render-waypoint';\nexport { default as shouldShowProperty } from './should-show-property';\nexport { default as sortResponseData } from './sort-response-data';\nexport { default as splitChildren } from './split-children';\nexport { default as getCurrentOffset } from './get-current-offset';\nexport { default as updateChildrensParent } from './update-childrens-parent';\nexport { default as getDisplayCountData } from './get-display-count-data';\nexport { default as buildImageProperties } from './build-image-properties';\nexport { default as getUpdatedFilterBy } from './get-updated-filter-by';\nexport { default as checkForError } from './check-for-error';\nexport { default as removeUnwantedCharacters } from './remove-unwanted-characters';\nexport { default as hasChildren } from './has-children';\nexport { default as removeExtraItems } from './remove-extra-items';\nexport { default as getParsedPropValues } from './get-parsed-prop-values';\nexport { default as getSanitizedPropValues } from './get-sanitized-prop-values';\nexport { default as appendImages } from './append-images';\nexport { default as parseTextBlock } from './parse-TextBlock';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,2BAA2B;AAC5E,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,0BAA0B;AACzE,SAASF,OAAO,IAAIG,eAAe,QAAQ,qBAAqB;AAChE,SAASH,OAAO,IAAII,gBAAgB,QAAQ,sBAAsB;AAClE,SAASJ,OAAO,IAAIK,aAAa,QAAQ,mBAAmB;AAC5D,SAASL,OAAO,IAAIM,iBAAiB,QAAQ,wBAAwB;AACrE,SAASN,OAAO,IAAIO,+BAA+B,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itizedPropValues from './get-sanitized-prop-values';
|
|
6
6
|
import { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';
|
|
7
|
-
import processDataSummaryValue from './process-data-summary-value';
|
|
8
7
|
|
|
9
8
|
// TODO this helper should be removed if database is wiped clean and all elements change to new props struc
|
|
10
9
|
const parsePropsToDisplay = (props = {}, propsToDisplay = []) => {
|
|
11
10
|
if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);
|
|
12
|
-
return propsToDisplay.map((
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = options;
|
|
11
|
+
return propsToDisplay.map(({
|
|
12
|
+
bold,
|
|
13
|
+
propertiesToDisplay,
|
|
14
|
+
prefix,
|
|
15
|
+
suffix,
|
|
16
|
+
shouldStrip,
|
|
17
|
+
enableLink
|
|
18
|
+
}, currentIndex) => {
|
|
21
19
|
const Wrapper = bold ? BOLD_TAG : Fragment;
|
|
22
20
|
const parsedPropValues = getParsedPropValues({
|
|
23
21
|
propertiesToDisplay,
|
|
@@ -28,8 +26,7 @@ const parsePropsToDisplay = (props = {}, propsToDisplay = []) => {
|
|
|
28
26
|
const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);
|
|
29
27
|
if (!sanitizedPropValues || !sanitizedPropValues.length) return null;
|
|
30
28
|
const stringEndBlank = currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;
|
|
31
|
-
|
|
32
|
-
return /*#__PURE__*/React.createElement(Wrapper, null, prefix, " ", processedValue, " ", suffix, stringEndBlank);
|
|
29
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, prefix, " ", sanitizedPropValues, " ", suffix, stringEndBlank);
|
|
33
30
|
});
|
|
34
31
|
};
|
|
35
32
|
export default parsePropsToDisplay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-props-to-display.js","names":["React","Fragment","at","isObject","getParsedPropValues","getSanitizedPropValues","BOLD_TAG","BLANK_SPACE_UNICODE_STRING","
|
|
1
|
+
{"version":3,"file":"parse-props-to-display.js","names":["React","Fragment","at","isObject","getParsedPropValues","getSanitizedPropValues","BOLD_TAG","BLANK_SPACE_UNICODE_STRING","parsePropsToDisplay","props","propsToDisplay","filter","Boolean","map","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","currentIndex","Wrapper","parsedPropValues","sanitizedPropValues","length","stringEndBlank","createElement"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map(\n ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n return (\n <Wrapper>\n {prefix} {sanitizedPropValues} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n }\n );\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,QAAQ,EAAEC,0BAA0B,QAAQ,cAAc;;AAEnE;AACA,MAAMC,mBAAmB,GAAGA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAEC,cAAc,GAAG,EAAE,KAAK;EAC/D,IAAI,CAACP,QAAQ,CAACO,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,OAAOR,EAAE,CAACO,KAAK,EAAEC,cAAc,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;EAElF,OAAOF,cAAc,CAACG,GAAG,CACvB,CAAC;IAAEC,IAAI;IAAEC,mBAAmB;IAAEC,MAAM;IAAEC,MAAM;IAAEC,WAAW;IAAEC;EAAW,CAAC,EAAEC,YAAY,KAAK;IACxF,MAAMC,OAAO,GAAGP,IAAI,GAAGR,QAAQ,GAAGL,QAAQ;IAE1C,MAAMqB,gBAAgB,GAAGlB,mBAAmB,CAAC;MAC3CW,mBAAmB;MACnBN,KAAK;MACLU,UAAU;MACVD;IACF,CAAC,CAAC;IAEF,MAAMK,mBAAmB,GAAGlB,sBAAsB,CAACiB,gBAAgB,CAAC;IACpE,IAAI,CAACC,mBAAmB,IAAI,CAACA,mBAAmB,CAACC,MAAM,EAAE,OAAO,IAAI;IACpE,MAAMC,cAAc,GAClBL,YAAY,GAAG,CAAC,KAAKV,cAAc,CAACc,MAAM,GAAG,EAAE,GAAGjB,0BAA0B;IAE9E,oBACEP,KAAA,CAAA0B,aAAA,CAACL,OAAO,QACLL,MAAM,EAAC,GAAC,EAACO,mBAAmB,EAAC,GAAC,EAACN,MAAM,EACrCQ,cACM,CAAC;EAEd,CACF,CAAC;AACH,CAAC;AAED,eAAejB,mBAAmB"}
|
|
@@ -29,7 +29,7 @@ const commonAttributes = {
|
|
|
29
29
|
};
|
|
30
30
|
const supportedTypes = {
|
|
31
31
|
row: {
|
|
32
|
-
props: [WIDTH, ...responsiveProps, ...commonProps]
|
|
32
|
+
props: [WIDTH, STICKY, ...responsiveProps, ...commonProps]
|
|
33
33
|
},
|
|
34
34
|
column: {
|
|
35
35
|
props: [WIDTH, STICKY, ...responsiveProps, ...commonProps]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-class-modifiers.js","names":["BUTTON","BUTTON_ICON","CLASS_MODIFIERS","ICON_BUTTON","LINK","CODE","COMPONENTS_DEFAULT_VALUES","BUTTON_TYPE","DEFAULT","DESKTOP","GTM_CLASS_NAME","HIDE","ICON","MOBILE","MODIFIER","SIZE","STICKY","STYLE","TABLET","WIDTH","ALIGNMENT","commonProps","responsiveProps","buttonProps","iconProps","commonAttributes","props","prefix","supportedTypes","row","column","button","icon","textBlock","_objectSpread","banner","image","hero","video","list","code","getClassModifiers","type","supportedProps","defaultValues","modifiers","map","prop","propValue","stringValue","isResponsiveProp","includes","undefined","filter","Boolean","unshift","join"],"sources":["../../src/utils/get-class-modifiers.js"],"sourcesContent":["import { BUTTON, BUTTON_ICON, CLASS_MODIFIERS, ICON_BUTTON, LINK, CODE } from '../constants';\nimport COMPONENTS_DEFAULT_VALUES from '../constants/componentsDefaultValues';\n\nconst {\n BUTTON_TYPE,\n DEFAULT,\n DESKTOP,\n GTM_CLASS_NAME,\n HIDE,\n ICON,\n MOBILE,\n MODIFIER,\n SIZE,\n STICKY,\n STYLE,\n TABLET,\n WIDTH,\n ALIGNMENT\n} = CLASS_MODIFIERS;\nconst commonProps = [GTM_CLASS_NAME, MODIFIER];\nconst responsiveProps = [DESKTOP, TABLET, MOBILE];\nconst buttonProps = [SIZE, BUTTON_TYPE, ICON, STYLE, ALIGNMENT, ...commonProps];\nconst iconProps = [BUTTON_TYPE, ...commonProps];\n\nconst commonAttributes = { props: commonProps, prefix: null };\n\nconst supportedTypes = {\n row: { props: [WIDTH, ...responsiveProps, ...commonProps] },\n column: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },\n button: {\n props: buttonProps,\n prefix: BUTTON\n },\n icon: { props: iconProps, prefix: ICON_BUTTON },\n textBlock: { ...commonAttributes },\n banner: { ...commonAttributes },\n image: { ...commonAttributes },\n hero: { ...commonAttributes },\n video: { ...commonAttributes },\n list: { ...commonAttributes },\n code: { ...commonAttributes, prefix: CODE }\n};\n\nexport default function getClassModifiers(type, props) {\n const { props: supportedProps, prefix } = supportedTypes[type] || {};\n const defaultValues = COMPONENTS_DEFAULT_VALUES[type] || {};\n if (!supportedProps) return '';\n\n const modifiers = supportedProps\n .map(prop => {\n const propValue = props[prop];\n const stringValue = typeof propValue === 'boolean' ? prop : propValue;\n const isResponsiveProp = responsiveProps.includes(prop);\n if (prop === ICON) return propValue ? BUTTON_ICON : '';\n if (prop === MODIFIER && propValue) return `${propValue}`;\n if (propValue === DEFAULT || stringValue === type) return '';\n if (isResponsiveProp) return propValue ? '' : `${HIDE}-${prop}`;\n if (propValue === null || propValue === undefined) return defaultValues[prop] || '';\n if (prop === WIDTH || prop === LINK) return `${type}--${propValue}`;\n if (prop === GTM_CLASS_NAME) return `${propValue}`;\n if (prop === STICKY) return propValue ? `${type}--${stringValue}` : '';\n\n return stringValue ? `${type}--${stringValue}` : '';\n })\n .filter(Boolean);\n if (prefix) modifiers.unshift(prefix);\n\n return modifiers.join(' ');\n}\n"],"mappings":";;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5F,OAAOC,yBAAyB,MAAM,sCAAsC;AAE5E,MAAM;EACJC,WAAW;EACXC,OAAO;EACPC,OAAO;EACPC,cAAc;EACdC,IAAI;EACJC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,IAAI;EACJC,MAAM;EACNC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC;AACF,CAAC,GAAGlB,eAAe;AACnB,MAAMmB,WAAW,GAAG,CAACX,cAAc,EAAEI,QAAQ,CAAC;AAC9C,MAAMQ,eAAe,GAAG,CAACb,OAAO,EAAES,MAAM,EAAEL,MAAM,CAAC;AACjD,MAAMU,WAAW,GAAG,CAACR,IAAI,EAAER,WAAW,EAAEK,IAAI,EAAEK,KAAK,EAAEG,SAAS,EAAE,GAAGC,WAAW,CAAC;AAC/E,MAAMG,SAAS,GAAG,CAACjB,WAAW,EAAE,GAAGc,WAAW,CAAC;AAE/C,MAAMI,gBAAgB,GAAG;EAAEC,KAAK,EAAEL,WAAW;EAAEM,MAAM,EAAE;AAAK,CAAC;AAE7D,MAAMC,cAAc,GAAG;EACrBC,GAAG,EAAE;IAAEH,KAAK,EAAE,CAACP,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"get-class-modifiers.js","names":["BUTTON","BUTTON_ICON","CLASS_MODIFIERS","ICON_BUTTON","LINK","CODE","COMPONENTS_DEFAULT_VALUES","BUTTON_TYPE","DEFAULT","DESKTOP","GTM_CLASS_NAME","HIDE","ICON","MOBILE","MODIFIER","SIZE","STICKY","STYLE","TABLET","WIDTH","ALIGNMENT","commonProps","responsiveProps","buttonProps","iconProps","commonAttributes","props","prefix","supportedTypes","row","column","button","icon","textBlock","_objectSpread","banner","image","hero","video","list","code","getClassModifiers","type","supportedProps","defaultValues","modifiers","map","prop","propValue","stringValue","isResponsiveProp","includes","undefined","filter","Boolean","unshift","join"],"sources":["../../src/utils/get-class-modifiers.js"],"sourcesContent":["import { BUTTON, BUTTON_ICON, CLASS_MODIFIERS, ICON_BUTTON, LINK, CODE } from '../constants';\nimport COMPONENTS_DEFAULT_VALUES from '../constants/componentsDefaultValues';\n\nconst {\n BUTTON_TYPE,\n DEFAULT,\n DESKTOP,\n GTM_CLASS_NAME,\n HIDE,\n ICON,\n MOBILE,\n MODIFIER,\n SIZE,\n STICKY,\n STYLE,\n TABLET,\n WIDTH,\n ALIGNMENT\n} = CLASS_MODIFIERS;\nconst commonProps = [GTM_CLASS_NAME, MODIFIER];\nconst responsiveProps = [DESKTOP, TABLET, MOBILE];\nconst buttonProps = [SIZE, BUTTON_TYPE, ICON, STYLE, ALIGNMENT, ...commonProps];\nconst iconProps = [BUTTON_TYPE, ...commonProps];\n\nconst commonAttributes = { props: commonProps, prefix: null };\n\nconst supportedTypes = {\n row: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },\n column: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },\n button: {\n props: buttonProps,\n prefix: BUTTON\n },\n icon: { props: iconProps, prefix: ICON_BUTTON },\n textBlock: { ...commonAttributes },\n banner: { ...commonAttributes },\n image: { ...commonAttributes },\n hero: { ...commonAttributes },\n video: { ...commonAttributes },\n list: { ...commonAttributes },\n code: { ...commonAttributes, prefix: CODE }\n};\n\nexport default function getClassModifiers(type, props) {\n const { props: supportedProps, prefix } = supportedTypes[type] || {};\n const defaultValues = COMPONENTS_DEFAULT_VALUES[type] || {};\n if (!supportedProps) return '';\n\n const modifiers = supportedProps\n .map(prop => {\n const propValue = props[prop];\n const stringValue = typeof propValue === 'boolean' ? prop : propValue;\n const isResponsiveProp = responsiveProps.includes(prop);\n if (prop === ICON) return propValue ? BUTTON_ICON : '';\n if (prop === MODIFIER && propValue) return `${propValue}`;\n if (propValue === DEFAULT || stringValue === type) return '';\n if (isResponsiveProp) return propValue ? '' : `${HIDE}-${prop}`;\n if (propValue === null || propValue === undefined) return defaultValues[prop] || '';\n if (prop === WIDTH || prop === LINK) return `${type}--${propValue}`;\n if (prop === GTM_CLASS_NAME) return `${propValue}`;\n if (prop === STICKY) return propValue ? `${type}--${stringValue}` : '';\n\n return stringValue ? `${type}--${stringValue}` : '';\n })\n .filter(Boolean);\n if (prefix) modifiers.unshift(prefix);\n\n return modifiers.join(' ');\n}\n"],"mappings":";;;AAAA,SAASA,MAAM,EAAEC,WAAW,EAAEC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5F,OAAOC,yBAAyB,MAAM,sCAAsC;AAE5E,MAAM;EACJC,WAAW;EACXC,OAAO;EACPC,OAAO;EACPC,cAAc;EACdC,IAAI;EACJC,IAAI;EACJC,MAA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EsC,SAAU,EAAC;IAClD,IAAID,IAAI,KAAK/B,MAAM,EAAE,OAAOgC,SAAS,GAAI,GAAEN,IAAK,KAAIO,WAAY,EAAC,GAAG,EAAE;IAEtE,OAAOA,WAAW,GAAI,GAAEP,IAAK,KAAIO,WAAY,EAAC,GAAG,EAAE;EACrD,CAAC,CAAC,CACDI,MAAM,CAACC,OAAO,CAAC;EAClB,IAAI3B,MAAM,EAAEkB,SAAS,CAACU,OAAO,CAAC5B,MAAM,CAAC;EAErC,OAAOkB,SAAS,CAACW,IAAI,CAAC,GAAG,CAAC;AAC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.131.
|
|
3
|
+
"version": "0.131.1",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/core-auth-ui": "0.131.0
|
|
31
|
-
"@blaze-cms/core-errors": "0.131.0
|
|
32
|
-
"@blaze-cms/core-errors-ui": "0.131.0
|
|
30
|
+
"@blaze-cms/core-auth-ui": "^0.131.0",
|
|
31
|
+
"@blaze-cms/core-errors": "^0.131.0",
|
|
32
|
+
"@blaze-cms/core-errors-ui": "^0.131.0",
|
|
33
33
|
"@blaze-cms/image-cdn-react": "0.3.0-alpha.5",
|
|
34
|
-
"@blaze-cms/nextjs-components": "0.131.0
|
|
35
|
-
"@blaze-cms/plugin-search-ui": "0.131.0
|
|
36
|
-
"@blaze-cms/setup-ui": "0.131.0
|
|
37
|
-
"@blaze-cms/utils": "0.131.0
|
|
38
|
-
"@blaze-cms/utils-handlebars": "0.131.0
|
|
34
|
+
"@blaze-cms/nextjs-components": "^0.131.0",
|
|
35
|
+
"@blaze-cms/plugin-search-ui": "^0.131.0",
|
|
36
|
+
"@blaze-cms/setup-ui": "^0.131.0",
|
|
37
|
+
"@blaze-cms/utils": "^0.131.0",
|
|
38
|
+
"@blaze-cms/utils-handlebars": "^0.131.0",
|
|
39
39
|
"@blaze-react/breadcrumb": "0.8.0-alpha.60",
|
|
40
40
|
"@blaze-react/button": "0.5.19",
|
|
41
41
|
"@blaze-react/checkboxes": "0.5.31",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"lib/*",
|
|
90
90
|
"lib-es/*"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "7023bf3e0ef207eda6ec8d85ab68d9fd6cc3a17a"
|
|
93
93
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
|
|
4
|
+
const recreateOnNavigation = Component => {
|
|
5
|
+
const InnerComponent = props => {
|
|
6
|
+
const { name } = props;
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const key = `${router.asPath}:${name}`;
|
|
9
|
+
return <Component {...props} key={key} />;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
InnerComponent.WrappedComponent = Component;
|
|
13
|
+
|
|
14
|
+
InnerComponent.displayName = `recreateOnNavigation(${Component.displayName ||
|
|
15
|
+
Component.name ||
|
|
16
|
+
'Component'})`;
|
|
17
|
+
|
|
18
|
+
return InnerComponent;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default recreateOnNavigation;
|
package/src/components/Button.js
CHANGED
|
@@ -59,8 +59,7 @@ const Button = props => {
|
|
|
59
59
|
|
|
60
60
|
const logout = () => {
|
|
61
61
|
handleLogout(client);
|
|
62
|
-
|
|
63
|
-
return url ? router.reload(urlToUse) : router.reload();
|
|
62
|
+
url ? router.reload(urlToUse) : router.reload();
|
|
64
63
|
};
|
|
65
64
|
|
|
66
65
|
const handleClick = () => {
|
|
@@ -101,12 +101,12 @@ const CardContainer = ({
|
|
|
101
101
|
{shouldRenderBanner && (
|
|
102
102
|
<Banner
|
|
103
103
|
key={dynamicKey}
|
|
104
|
-
{...entityProps}
|
|
105
|
-
{...bannerProps}
|
|
106
|
-
renderCounter={bannerIndex}
|
|
107
104
|
entity={graphqlEntityMap[entityProps.__typename]}
|
|
108
105
|
baseAdunit={baseAdunit}
|
|
106
|
+
{...entityProps}
|
|
107
|
+
{...bannerProps}
|
|
109
108
|
modifier={modifier}
|
|
109
|
+
renderCounter={bannerIndex}
|
|
110
110
|
/>
|
|
111
111
|
)}
|
|
112
112
|
</>
|