@daffodil/geography 0.39.13 → 0.40.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/daffodil-geography.d.ts +1 -0
- package/driver/daffodil-geography-driver.d.ts +1 -0
- package/driver/in-memory/backend/geography.service.d.ts +3 -0
- package/driver/in-memory/daffodil-geography-driver-in-memory.d.ts +1 -0
- package/driver/in-memory/drivers/geography-driver.module.d.ts +5 -0
- package/driver/in-memory/drivers/geography.service.d.ts +3 -0
- package/driver/in-memory/package.json +5 -6
- package/driver/magento/daffodil-geography-driver-magento.d.ts +1 -0
- package/driver/magento/errors/transform.d.ts +1 -1
- package/driver/magento/geography-driver.module.d.ts +5 -0
- package/driver/magento/geography.service.d.ts +4 -1
- package/driver/magento/package.json +5 -6
- package/driver/magento/queries/fragments/country.d.ts +1 -1
- package/driver/magento/queries/fragments/region.d.ts +1 -1
- package/driver/magento/queries/get-countries.d.ts +1 -1
- package/driver/magento/queries/get-country.d.ts +1 -1
- package/driver/magento/transforms/responses/country.service.d.ts +3 -0
- package/driver/magento/transforms/responses/subdivision.service.d.ts +3 -0
- package/driver/package.json +5 -6
- package/driver/testing/daffodil-geography-driver-testing.d.ts +1 -0
- package/driver/testing/drivers/geography-driver.module.d.ts +5 -0
- package/driver/testing/drivers/geography.service.d.ts +3 -0
- package/driver/testing/package.json +5 -6
- package/{esm2015/comparators/address.js → esm2020/comparators/address.mjs} +0 -0
- package/{esm2015/comparators/personal-address.js → esm2020/comparators/personal-address.mjs} +0 -0
- package/{esm2015/comparators/public_api.js → esm2020/comparators/public_api.mjs} +0 -0
- package/{esm2015/daffodil-geography.js → esm2020/daffodil-geography.mjs} +0 -0
- package/{esm2015/driver/daffodil-geography-driver.js → esm2020/driver/daffodil-geography-driver.mjs} +0 -0
- package/{esm2015/driver/errors/country-not-found.js → esm2020/driver/errors/country-not-found.mjs} +0 -0
- package/{esm2015/driver/errors/invalid-api-response.js → esm2020/driver/errors/invalid-api-response.mjs} +0 -0
- package/{esm2015/driver/errors/public_api.js → esm2020/driver/errors/public_api.mjs} +0 -0
- package/esm2020/driver/in-memory/backend/geography.service.mjs +59 -0
- package/{esm2015/driver/in-memory/daffodil-geography-driver-in-memory.js → esm2020/driver/in-memory/daffodil-geography-driver-in-memory.mjs} +0 -0
- package/esm2020/driver/in-memory/drivers/geography-driver.module.mjs +32 -0
- package/esm2020/driver/in-memory/drivers/geography.service.mjs +31 -0
- package/{esm2015/driver/in-memory/drivers/public_api.js → esm2020/driver/in-memory/drivers/public_api.mjs} +0 -0
- package/{esm2015/driver/in-memory/index.js → esm2020/driver/in-memory/index.mjs} +0 -0
- package/{esm2015/driver/in-memory/public_api.js → esm2020/driver/in-memory/public_api.mjs} +0 -0
- package/{esm2015/driver/index.js → esm2020/driver/index.mjs} +0 -0
- package/{esm2015/driver/interfaces/geography-service.interface.js → esm2020/driver/interfaces/geography-service.interface.mjs} +0 -0
- package/{esm2015/driver/magento/daffodil-geography-driver-magento.js → esm2020/driver/magento/daffodil-geography-driver-magento.mjs} +0 -0
- package/{esm2015/driver/magento/errors/codes.js → esm2020/driver/magento/errors/codes.mjs} +0 -0
- package/{esm2015/driver/magento/errors/map.js → esm2020/driver/magento/errors/map.mjs} +0 -0
- package/{esm2015/driver/magento/errors/transform.js → esm2020/driver/magento/errors/transform.mjs} +0 -0
- package/esm2020/driver/magento/geography-driver.module.mjs +32 -0
- package/esm2020/driver/magento/geography.service.mjs +45 -0
- package/{esm2015/driver/magento/index.js → esm2020/driver/magento/index.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/country.js → esm2020/driver/magento/models/responses/country.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/public_api.js → esm2020/driver/magento/models/responses/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/models/responses/region.js → esm2020/driver/magento/models/responses/region.mjs} +0 -0
- package/{esm2015/driver/magento/public_api.js → esm2020/driver/magento/public_api.mjs} +0 -0
- package/esm2020/driver/magento/queries/fragments/country.mjs +11 -0
- package/{esm2015/driver/magento/queries/fragments/public_api.js → esm2020/driver/magento/queries/fragments/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/queries/fragments/region.js → esm2020/driver/magento/queries/fragments/region.mjs} +2 -2
- package/{esm2015/driver/magento/queries/get-countries.js → esm2020/driver/magento/queries/get-countries.mjs} +2 -2
- package/esm2020/driver/magento/queries/get-country.mjs +15 -0
- package/{esm2015/driver/magento/queries/public_api.js → esm2020/driver/magento/queries/public_api.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-countries.js → esm2020/driver/magento/queries/responses/get-countries.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/get-country.js → esm2020/driver/magento/queries/responses/get-country.mjs} +0 -0
- package/{esm2015/driver/magento/queries/responses/public_api.js → esm2020/driver/magento/queries/responses/public_api.mjs} +0 -0
- package/esm2020/driver/magento/transforms/responses/country.service.mjs +38 -0
- package/esm2020/driver/magento/transforms/responses/subdivision.service.mjs +27 -0
- package/{esm2015/driver/magento/validators/get-countries.js → esm2020/driver/magento/validators/get-countries.mjs} +0 -0
- package/{esm2015/driver/magento/validators/public_api.js → esm2020/driver/magento/validators/public_api.mjs} +0 -0
- package/{esm2015/driver/testing/daffodil-geography-driver-testing.js → esm2020/driver/testing/daffodil-geography-driver-testing.mjs} +0 -0
- package/esm2020/driver/testing/drivers/geography-driver.module.mjs +32 -0
- package/esm2020/driver/testing/drivers/geography.service.mjs +32 -0
- package/{esm2015/driver/testing/drivers/public_api.js → esm2020/driver/testing/drivers/public_api.mjs} +0 -0
- package/{esm2015/driver/testing/index.js → esm2020/driver/testing/index.mjs} +0 -0
- package/{esm2015/driver/testing/public_api.js → esm2020/driver/testing/public_api.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/injection-tokens/error-matcher.token.js → esm2020/injection-tokens/error-matcher.token.mjs} +0 -0
- package/{esm2015/injection-tokens/public_api.js → esm2020/injection-tokens/public_api.mjs} +0 -0
- package/{esm2015/models/address.js → esm2020/models/address.mjs} +0 -0
- package/{esm2015/models/country.js → esm2020/models/country.mjs} +0 -0
- package/{esm2015/models/personal-address.js → esm2020/models/personal-address.mjs} +0 -0
- package/{esm2015/models/public_api.js → esm2020/models/public_api.mjs} +0 -0
- package/{esm2015/models/subdivision.js → esm2020/models/subdivision.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/{esm2015/state/actions/geography.actions.js → esm2020/state/actions/geography.actions.mjs} +0 -0
- package/{esm2015/state/actions/public_api.js → esm2020/state/actions/public_api.mjs} +0 -0
- package/esm2020/state/daffodil-geography-state.mjs +5 -0
- package/esm2020/state/effects/geography.effects.mjs +30 -0
- package/{esm2015/state/facades/geography/geography-facade.interface.js → esm2020/state/facades/geography/geography-facade.interface.mjs} +0 -0
- package/esm2020/state/facades/geography/geography.facade.mjs +44 -0
- package/esm2020/state/geography-state.module.mjs +30 -0
- package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
- package/{esm2015/state/reducers/country-entities/country-entities-adapter.js → esm2020/state/reducers/country-entities/country-entities-adapter.mjs} +5 -7
- package/{esm2015/state/reducers/country-entities/country-entities-initial-state.js → esm2020/state/reducers/country-entities/country-entities-initial-state.mjs} +0 -0
- package/{esm2015/state/reducers/country-entities/country-entities-state.interface.js → esm2020/state/reducers/country-entities/country-entities-state.interface.mjs} +0 -0
- package/esm2020/state/reducers/country-entities/country-entities.reducer.mjs +29 -0
- package/{esm2015/state/reducers/country-entities/public_api.js → esm2020/state/reducers/country-entities/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/geography/geography-initial-state.js → esm2020/state/reducers/geography/geography-initial-state.mjs} +0 -0
- package/{esm2015/state/reducers/geography/geography-state.interface.js → esm2020/state/reducers/geography/geography-state.interface.mjs} +0 -0
- package/{esm2015/state/reducers/geography/geography.reducer.js → esm2020/state/reducers/geography/geography.reducer.mjs} +13 -5
- package/{esm2015/state/reducers/geography/public_api.js → esm2020/state/reducers/geography/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/geography-reducers-state.interface.js → esm2020/state/reducers/geography-reducers-state.interface.mjs} +0 -0
- package/{esm2015/state/reducers/geography-reducers.js → esm2020/state/reducers/geography-reducers.mjs} +0 -0
- package/{esm2015/state/reducers/geography-store-feature-key.js → esm2020/state/reducers/geography-store-feature-key.mjs} +0 -0
- package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
- package/esm2020/state/selectors/country-entities.selector.mjs +48 -0
- package/esm2020/state/selectors/geography-all.selector.mjs +12 -0
- package/esm2020/state/selectors/geography-feature.selector.mjs +9 -0
- package/esm2020/state/selectors/geography.selector.mjs +18 -0
- package/{esm2015/state/selectors/public_api.js → esm2020/state/selectors/public_api.mjs} +0 -0
- package/{esm2015/state/testing/daffodil-geography-state-testing.js → esm2020/state/testing/daffodil-geography-state-testing.mjs} +0 -0
- package/esm2020/state/testing/geography-testing.module.mjs +20 -0
- package/{esm2015/state/testing/index.js → esm2020/state/testing/index.mjs} +0 -0
- package/esm2020/state/testing/mock-geography-facade.mjs +34 -0
- package/{esm2015/state/testing/public_api.js → esm2020/state/testing/public_api.mjs} +0 -0
- package/{esm2015/testing/daffodil-geography-testing.js → esm2020/testing/daffodil-geography-testing.mjs} +0 -0
- package/esm2020/testing/factories/address.factory.mjs +28 -0
- package/esm2020/testing/factories/country.factory.mjs +28 -0
- package/esm2020/testing/factories/personal-address.factory.mjs +31 -0
- package/{esm2015/testing/factories/public_api.js → esm2020/testing/factories/public_api.mjs} +0 -0
- package/esm2020/testing/factories/subdivision.factory.mjs +25 -0
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
- package/fesm2015/daffodil-geography-driver-in-memory.mjs +121 -0
- package/fesm2015/daffodil-geography-driver-in-memory.mjs.map +1 -0
- package/fesm2015/{daffodil-geography-driver-magento.js → daffodil-geography-driver-magento.mjs} +42 -37
- package/fesm2015/daffodil-geography-driver-magento.mjs.map +1 -0
- package/fesm2015/daffodil-geography-driver-testing.mjs +67 -0
- package/fesm2015/daffodil-geography-driver-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-geography-driver.js → daffodil-geography-driver.mjs} +1 -1
- package/fesm2015/daffodil-geography-driver.mjs.map +1 -0
- package/fesm2015/daffodil-geography-state-testing.mjs +58 -0
- package/fesm2015/daffodil-geography-state-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-geography-state.js → daffodil-geography-state.mjs} +62 -72
- package/fesm2015/daffodil-geography-state.mjs.map +1 -0
- package/fesm2015/daffodil-geography-testing.mjs +106 -0
- package/fesm2015/daffodil-geography-testing.mjs.map +1 -0
- package/fesm2015/{daffodil-geography.js → daffodil-geography.mjs} +1 -1
- package/fesm2015/daffodil-geography.mjs.map +1 -0
- package/fesm2020/daffodil-geography-driver-in-memory.mjs +121 -0
- package/fesm2020/daffodil-geography-driver-in-memory.mjs.map +1 -0
- package/fesm2020/daffodil-geography-driver-magento.mjs +197 -0
- package/fesm2020/daffodil-geography-driver-magento.mjs.map +1 -0
- package/fesm2020/daffodil-geography-driver-testing.mjs +67 -0
- package/fesm2020/daffodil-geography-driver-testing.mjs.map +1 -0
- package/fesm2020/daffodil-geography-driver.mjs +27 -0
- package/fesm2020/daffodil-geography-driver.mjs.map +1 -0
- package/fesm2020/daffodil-geography-state-testing.mjs +58 -0
- package/fesm2020/daffodil-geography-state-testing.mjs.map +1 -0
- package/fesm2020/daffodil-geography-state.mjs +300 -0
- package/fesm2020/daffodil-geography-state.mjs.map +1 -0
- package/fesm2020/daffodil-geography-testing.mjs +106 -0
- package/fesm2020/daffodil-geography-testing.mjs.map +1 -0
- package/fesm2020/daffodil-geography.mjs +54 -0
- package/fesm2020/daffodil-geography.mjs.map +1 -0
- package/package.json +79 -11
- package/state/daffodil-geography-state.d.ts +1 -1
- package/state/effects/geography.effects.d.ts +5 -2
- package/state/facades/geography/geography.facade.d.ts +3 -0
- package/state/geography-state.module.d.ts +6 -0
- package/state/package.json +5 -6
- package/state/testing/daffodil-geography-state-testing.d.ts +1 -0
- package/state/testing/geography-testing.module.d.ts +4 -0
- package/state/testing/mock-geography-facade.d.ts +3 -0
- package/state/testing/package.json +5 -6
- package/testing/daffodil-geography-testing.d.ts +1 -0
- package/testing/factories/address.factory.d.ts +3 -0
- package/testing/factories/country.factory.d.ts +3 -0
- package/testing/factories/personal-address.factory.d.ts +3 -0
- package/testing/factories/subdivision.factory.d.ts +3 -0
- package/testing/package.json +5 -6
- package/bundles/daffodil-geography-driver-in-memory.umd.js +0 -129
- package/bundles/daffodil-geography-driver-in-memory.umd.js.map +0 -1
- package/bundles/daffodil-geography-driver-in-memory.umd.min.js +0 -2
- package/bundles/daffodil-geography-driver-in-memory.umd.min.js.map +0 -1
- package/bundles/daffodil-geography-driver-magento.umd.js +0 -490
- package/bundles/daffodil-geography-driver-magento.umd.js.map +0 -1
- package/bundles/daffodil-geography-driver-magento.umd.min.js +0 -2
- package/bundles/daffodil-geography-driver-magento.umd.min.js.map +0 -1
- package/bundles/daffodil-geography-driver-testing.umd.js +0 -72
- package/bundles/daffodil-geography-driver-testing.umd.js.map +0 -1
- package/bundles/daffodil-geography-driver-testing.umd.min.js +0 -2
- package/bundles/daffodil-geography-driver-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-geography-driver.umd.js +0 -360
- package/bundles/daffodil-geography-driver.umd.js.map +0 -1
- package/bundles/daffodil-geography-driver.umd.min.js +0 -16
- package/bundles/daffodil-geography-driver.umd.min.js.map +0 -1
- package/bundles/daffodil-geography-state-testing.umd.js +0 -60
- package/bundles/daffodil-geography-state-testing.umd.js.map +0 -1
- package/bundles/daffodil-geography-state-testing.umd.min.js +0 -2
- package/bundles/daffodil-geography-state-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-geography-state.umd.js +0 -649
- package/bundles/daffodil-geography-state.umd.js.map +0 -1
- package/bundles/daffodil-geography-state.umd.min.js +0 -16
- package/bundles/daffodil-geography-state.umd.min.js.map +0 -1
- package/bundles/daffodil-geography-testing.umd.js +0 -450
- package/bundles/daffodil-geography-testing.umd.js.map +0 -1
- package/bundles/daffodil-geography-testing.umd.min.js +0 -16
- package/bundles/daffodil-geography-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-geography.umd.js +0 -63
- package/bundles/daffodil-geography.umd.js.map +0 -1
- package/bundles/daffodil-geography.umd.min.js +0 -2
- package/bundles/daffodil-geography.umd.min.js.map +0 -1
- package/daffodil-geography.metadata.json +0 -1
- package/driver/daffodil-geography-driver.metadata.json +0 -1
- package/driver/in-memory/daffodil-geography-driver-in-memory.metadata.json +0 -1
- package/driver/magento/daffodil-geography-driver-magento.metadata.json +0 -1
- package/driver/testing/daffodil-geography-driver-testing.metadata.json +0 -1
- package/esm2015/driver/in-memory/backend/geography.service.js +0 -62
- package/esm2015/driver/in-memory/drivers/geography-driver.module.js +0 -25
- package/esm2015/driver/in-memory/drivers/geography.service.js +0 -33
- package/esm2015/driver/magento/geography-driver.module.js +0 -25
- package/esm2015/driver/magento/geography.service.js +0 -48
- package/esm2015/driver/magento/queries/fragments/country.js +0 -11
- package/esm2015/driver/magento/queries/get-country.js +0 -15
- package/esm2015/driver/magento/transforms/responses/country.service.js +0 -32
- package/esm2015/driver/magento/transforms/responses/subdivision.service.js +0 -20
- package/esm2015/driver/testing/drivers/geography-driver.module.js +0 -25
- package/esm2015/driver/testing/drivers/geography.service.js +0 -35
- package/esm2015/state/daffodil-geography-state.js +0 -6
- package/esm2015/state/effects/geography.effects.js +0 -43
- package/esm2015/state/facades/geography/geography.facade.js +0 -46
- package/esm2015/state/geography-state.module.js +0 -18
- package/esm2015/state/reducers/country-entities/country-entities.reducer.js +0 -24
- package/esm2015/state/selectors/country-entities.selector.js +0 -51
- package/esm2015/state/selectors/geography-all.selector.js +0 -10
- package/esm2015/state/selectors/geography-feature.selector.js +0 -11
- package/esm2015/state/selectors/geography.selector.js +0 -21
- package/esm2015/state/testing/geography-testing.module.js +0 -13
- package/esm2015/state/testing/mock-geography-facade.js +0 -32
- package/esm2015/testing/factories/address.factory.js +0 -28
- package/esm2015/testing/factories/country.factory.js +0 -28
- package/esm2015/testing/factories/personal-address.factory.js +0 -31
- package/esm2015/testing/factories/subdivision.factory.js +0 -25
- package/fesm2015/daffodil-geography-driver-in-memory.js +0 -119
- package/fesm2015/daffodil-geography-driver-in-memory.js.map +0 -1
- package/fesm2015/daffodil-geography-driver-magento.js.map +0 -1
- package/fesm2015/daffodil-geography-driver-testing.js +0 -63
- package/fesm2015/daffodil-geography-driver-testing.js.map +0 -1
- package/fesm2015/daffodil-geography-driver.js.map +0 -1
- package/fesm2015/daffodil-geography-state-testing.js +0 -49
- package/fesm2015/daffodil-geography-state-testing.js.map +0 -1
- package/fesm2015/daffodil-geography-state.js.map +0 -1
- package/fesm2015/daffodil-geography-testing.js +0 -105
- package/fesm2015/daffodil-geography-testing.js.map +0 -1
- package/fesm2015/daffodil-geography.js.map +0 -1
- package/state/daffodil-geography-state.metadata.json +0 -1
- package/state/testing/daffodil-geography-state-testing.metadata.json +0 -1
- package/testing/daffodil-geography-testing.metadata.json +0 -1
|
@@ -1,649 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@ngrx/store'), require('@ngrx/entity'), require('@angular/core'), require('@ngrx/effects'), require('rxjs'), require('rxjs/operators'), require('@daffodil/geography'), require('@daffodil/geography/driver')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@daffodil/geography/state', ['exports', '@ngrx/store', '@ngrx/entity', '@angular/core', '@ngrx/effects', 'rxjs', 'rxjs/operators', '@daffodil/geography', '@daffodil/geography/driver'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.geography = global.daffodil.geography || {}, global.daffodil.geography.state = {}), global.i1, global.entity, global.ng.core, global.effects, global.rxjs, global.rxjs.operators, global.daffodil.geography, global.daffodil.geography.driver));
|
|
5
|
-
}(this, (function (exports, i1, entity, i0, effects, rxjs, operators, geography, driver) { 'use strict';
|
|
6
|
-
|
|
7
|
-
(function (DaffGeographyActionTypes) {
|
|
8
|
-
DaffGeographyActionTypes["CountryLoadAction"] = "[DaffGeography] Country Load Action";
|
|
9
|
-
DaffGeographyActionTypes["CountryLoadSuccessAction"] = "[DaffGeography] Country Load Success Action";
|
|
10
|
-
DaffGeographyActionTypes["CountryLoadFailureAction"] = "[DaffGeography] Country Load Failure Action";
|
|
11
|
-
DaffGeographyActionTypes["CountryListAction"] = "[DaffGeography] Country List Action";
|
|
12
|
-
DaffGeographyActionTypes["CountryListSuccessAction"] = "[DaffGeography] Country List Success Action";
|
|
13
|
-
DaffGeographyActionTypes["CountryListFailureAction"] = "[DaffGeography] Country List Failure Action";
|
|
14
|
-
})(exports.DaffGeographyActionTypes || (exports.DaffGeographyActionTypes = {}));
|
|
15
|
-
var DaffCountryLoad = /** @class */ (function () {
|
|
16
|
-
function DaffCountryLoad(payload) {
|
|
17
|
-
this.payload = payload;
|
|
18
|
-
this.type = exports.DaffGeographyActionTypes.CountryLoadAction;
|
|
19
|
-
}
|
|
20
|
-
return DaffCountryLoad;
|
|
21
|
-
}());
|
|
22
|
-
var DaffCountryLoadSuccess = /** @class */ (function () {
|
|
23
|
-
function DaffCountryLoadSuccess(payload) {
|
|
24
|
-
this.payload = payload;
|
|
25
|
-
this.type = exports.DaffGeographyActionTypes.CountryLoadSuccessAction;
|
|
26
|
-
}
|
|
27
|
-
return DaffCountryLoadSuccess;
|
|
28
|
-
}());
|
|
29
|
-
var DaffCountryLoadFailure = /** @class */ (function () {
|
|
30
|
-
function DaffCountryLoadFailure(payload) {
|
|
31
|
-
this.payload = payload;
|
|
32
|
-
this.type = exports.DaffGeographyActionTypes.CountryLoadFailureAction;
|
|
33
|
-
}
|
|
34
|
-
return DaffCountryLoadFailure;
|
|
35
|
-
}());
|
|
36
|
-
var DaffCountryList = /** @class */ (function () {
|
|
37
|
-
function DaffCountryList() {
|
|
38
|
-
this.type = exports.DaffGeographyActionTypes.CountryListAction;
|
|
39
|
-
}
|
|
40
|
-
return DaffCountryList;
|
|
41
|
-
}());
|
|
42
|
-
var DaffCountryListSuccess = /** @class */ (function () {
|
|
43
|
-
function DaffCountryListSuccess(payload) {
|
|
44
|
-
this.payload = payload;
|
|
45
|
-
this.type = exports.DaffGeographyActionTypes.CountryListSuccessAction;
|
|
46
|
-
}
|
|
47
|
-
return DaffCountryListSuccess;
|
|
48
|
-
}());
|
|
49
|
-
var DaffCountryListFailure = /** @class */ (function () {
|
|
50
|
-
function DaffCountryListFailure(payload) {
|
|
51
|
-
this.payload = payload;
|
|
52
|
-
this.type = exports.DaffGeographyActionTypes.CountryListFailureAction;
|
|
53
|
-
}
|
|
54
|
-
return DaffCountryListFailure;
|
|
55
|
-
}());
|
|
56
|
-
|
|
57
|
-
var ɵ0 = function () {
|
|
58
|
-
var cache;
|
|
59
|
-
return function () { return cache = cache || entity.createEntityAdapter(); };
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Country Adapter for changing/overwriting entity state.
|
|
63
|
-
*/
|
|
64
|
-
var getCountryAdapter = (ɵ0)();
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Initial state for country entity state.
|
|
68
|
-
*/
|
|
69
|
-
var daffCountryEntitiesInitialState = getCountryAdapter().getInitialState();
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Reducer function that catches actions and changes/overwrites country entities state.
|
|
73
|
-
*/
|
|
74
|
-
function daffCountryEntitiesReducer(state, action) {
|
|
75
|
-
if (state === void 0) { state = daffCountryEntitiesInitialState; }
|
|
76
|
-
var adapter = getCountryAdapter();
|
|
77
|
-
switch (action.type) {
|
|
78
|
-
case exports.DaffGeographyActionTypes.CountryLoadSuccessAction:
|
|
79
|
-
return adapter.upsertOne(Object.assign(Object.assign({}, action.payload), { loaded: true }), state);
|
|
80
|
-
case exports.DaffGeographyActionTypes.CountryListSuccessAction:
|
|
81
|
-
return adapter.upsertMany(action.payload.map(function (country) { return (Object.assign(Object.assign({}, country), {
|
|
82
|
-
// defer to the loaded state of the country already in state (if it exists) but init field to false if it does not
|
|
83
|
-
loaded: (state.entities[country.id] && state.entities[country.id].loaded) || false,
|
|
84
|
-
// if the country coming in has no subdivisions and the same country in state does, use the subdivisions in state
|
|
85
|
-
subdivisions: country.subdivisions.length === 0 && state.entities[country.id] && state.entities[country.id].subdivisions.length > 0
|
|
86
|
-
? state.entities[country.id].subdivisions
|
|
87
|
-
: country.subdivisions
|
|
88
|
-
})); }), state);
|
|
89
|
-
default:
|
|
90
|
-
return state;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/*! *****************************************************************************
|
|
95
|
-
Copyright (c) Microsoft Corporation.
|
|
96
|
-
|
|
97
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
98
|
-
purpose with or without fee is hereby granted.
|
|
99
|
-
|
|
100
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
101
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
102
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
103
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
104
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
105
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
106
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
107
|
-
***************************************************************************** */
|
|
108
|
-
/* global Reflect, Promise */
|
|
109
|
-
var extendStatics = function (d, b) {
|
|
110
|
-
extendStatics = Object.setPrototypeOf ||
|
|
111
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
112
|
-
function (d, b) { for (var p in b)
|
|
113
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
114
|
-
d[p] = b[p]; };
|
|
115
|
-
return extendStatics(d, b);
|
|
116
|
-
};
|
|
117
|
-
function __extends(d, b) {
|
|
118
|
-
if (typeof b !== "function" && b !== null)
|
|
119
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
120
|
-
extendStatics(d, b);
|
|
121
|
-
function __() { this.constructor = d; }
|
|
122
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
123
|
-
}
|
|
124
|
-
var __assign = function () {
|
|
125
|
-
__assign = Object.assign || function __assign(t) {
|
|
126
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
127
|
-
s = arguments[i];
|
|
128
|
-
for (var p in s)
|
|
129
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
130
|
-
t[p] = s[p];
|
|
131
|
-
}
|
|
132
|
-
return t;
|
|
133
|
-
};
|
|
134
|
-
return __assign.apply(this, arguments);
|
|
135
|
-
};
|
|
136
|
-
function __rest(s, e) {
|
|
137
|
-
var t = {};
|
|
138
|
-
for (var p in s)
|
|
139
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
140
|
-
t[p] = s[p];
|
|
141
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
142
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
143
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
144
|
-
t[p[i]] = s[p[i]];
|
|
145
|
-
}
|
|
146
|
-
return t;
|
|
147
|
-
}
|
|
148
|
-
function __decorate(decorators, target, key, desc) {
|
|
149
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
150
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
151
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
152
|
-
else
|
|
153
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
154
|
-
if (d = decorators[i])
|
|
155
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
156
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
157
|
-
}
|
|
158
|
-
function __param(paramIndex, decorator) {
|
|
159
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
160
|
-
}
|
|
161
|
-
function __metadata(metadataKey, metadataValue) {
|
|
162
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
163
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
164
|
-
}
|
|
165
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
166
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
167
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
168
|
-
function fulfilled(value) { try {
|
|
169
|
-
step(generator.next(value));
|
|
170
|
-
}
|
|
171
|
-
catch (e) {
|
|
172
|
-
reject(e);
|
|
173
|
-
} }
|
|
174
|
-
function rejected(value) { try {
|
|
175
|
-
step(generator["throw"](value));
|
|
176
|
-
}
|
|
177
|
-
catch (e) {
|
|
178
|
-
reject(e);
|
|
179
|
-
} }
|
|
180
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
181
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
function __generator(thisArg, body) {
|
|
185
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
186
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
187
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
188
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
189
|
-
function step(op) {
|
|
190
|
-
if (f)
|
|
191
|
-
throw new TypeError("Generator is already executing.");
|
|
192
|
-
while (_)
|
|
193
|
-
try {
|
|
194
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
195
|
-
return t;
|
|
196
|
-
if (y = 0, t)
|
|
197
|
-
op = [op[0] & 2, t.value];
|
|
198
|
-
switch (op[0]) {
|
|
199
|
-
case 0:
|
|
200
|
-
case 1:
|
|
201
|
-
t = op;
|
|
202
|
-
break;
|
|
203
|
-
case 4:
|
|
204
|
-
_.label++;
|
|
205
|
-
return { value: op[1], done: false };
|
|
206
|
-
case 5:
|
|
207
|
-
_.label++;
|
|
208
|
-
y = op[1];
|
|
209
|
-
op = [0];
|
|
210
|
-
continue;
|
|
211
|
-
case 7:
|
|
212
|
-
op = _.ops.pop();
|
|
213
|
-
_.trys.pop();
|
|
214
|
-
continue;
|
|
215
|
-
default:
|
|
216
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
217
|
-
_ = 0;
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
221
|
-
_.label = op[1];
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
225
|
-
_.label = t[1];
|
|
226
|
-
t = op;
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
if (t && _.label < t[2]) {
|
|
230
|
-
_.label = t[2];
|
|
231
|
-
_.ops.push(op);
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
if (t[2])
|
|
235
|
-
_.ops.pop();
|
|
236
|
-
_.trys.pop();
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
op = body.call(thisArg, _);
|
|
240
|
-
}
|
|
241
|
-
catch (e) {
|
|
242
|
-
op = [6, e];
|
|
243
|
-
y = 0;
|
|
244
|
-
}
|
|
245
|
-
finally {
|
|
246
|
-
f = t = 0;
|
|
247
|
-
}
|
|
248
|
-
if (op[0] & 5)
|
|
249
|
-
throw op[1];
|
|
250
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
254
|
-
if (k2 === undefined)
|
|
255
|
-
k2 = k;
|
|
256
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
257
|
-
}) : (function (o, m, k, k2) {
|
|
258
|
-
if (k2 === undefined)
|
|
259
|
-
k2 = k;
|
|
260
|
-
o[k2] = m[k];
|
|
261
|
-
});
|
|
262
|
-
function __exportStar(m, o) {
|
|
263
|
-
for (var p in m)
|
|
264
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
265
|
-
__createBinding(o, m, p);
|
|
266
|
-
}
|
|
267
|
-
function __values(o) {
|
|
268
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
269
|
-
if (m)
|
|
270
|
-
return m.call(o);
|
|
271
|
-
if (o && typeof o.length === "number")
|
|
272
|
-
return {
|
|
273
|
-
next: function () {
|
|
274
|
-
if (o && i >= o.length)
|
|
275
|
-
o = void 0;
|
|
276
|
-
return { value: o && o[i++], done: !o };
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
280
|
-
}
|
|
281
|
-
function __read(o, n) {
|
|
282
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
283
|
-
if (!m)
|
|
284
|
-
return o;
|
|
285
|
-
var i = m.call(o), r, ar = [], e;
|
|
286
|
-
try {
|
|
287
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
288
|
-
ar.push(r.value);
|
|
289
|
-
}
|
|
290
|
-
catch (error) {
|
|
291
|
-
e = { error: error };
|
|
292
|
-
}
|
|
293
|
-
finally {
|
|
294
|
-
try {
|
|
295
|
-
if (r && !r.done && (m = i["return"]))
|
|
296
|
-
m.call(i);
|
|
297
|
-
}
|
|
298
|
-
finally {
|
|
299
|
-
if (e)
|
|
300
|
-
throw e.error;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
return ar;
|
|
304
|
-
}
|
|
305
|
-
/** @deprecated */
|
|
306
|
-
function __spread() {
|
|
307
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
308
|
-
ar = ar.concat(__read(arguments[i]));
|
|
309
|
-
return ar;
|
|
310
|
-
}
|
|
311
|
-
/** @deprecated */
|
|
312
|
-
function __spreadArrays() {
|
|
313
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
314
|
-
s += arguments[i].length;
|
|
315
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
316
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
317
|
-
r[k] = a[j];
|
|
318
|
-
return r;
|
|
319
|
-
}
|
|
320
|
-
function __spreadArray(to, from, pack) {
|
|
321
|
-
if (pack || arguments.length === 2)
|
|
322
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
323
|
-
if (ar || !(i in from)) {
|
|
324
|
-
if (!ar)
|
|
325
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
326
|
-
ar[i] = from[i];
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
330
|
-
}
|
|
331
|
-
function __await(v) {
|
|
332
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
333
|
-
}
|
|
334
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
335
|
-
if (!Symbol.asyncIterator)
|
|
336
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
337
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
338
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
339
|
-
function verb(n) { if (g[n])
|
|
340
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
341
|
-
function resume(n, v) { try {
|
|
342
|
-
step(g[n](v));
|
|
343
|
-
}
|
|
344
|
-
catch (e) {
|
|
345
|
-
settle(q[0][3], e);
|
|
346
|
-
} }
|
|
347
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
348
|
-
function fulfill(value) { resume("next", value); }
|
|
349
|
-
function reject(value) { resume("throw", value); }
|
|
350
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
351
|
-
resume(q[0][0], q[0][1]); }
|
|
352
|
-
}
|
|
353
|
-
function __asyncDelegator(o) {
|
|
354
|
-
var i, p;
|
|
355
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
356
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
357
|
-
}
|
|
358
|
-
function __asyncValues(o) {
|
|
359
|
-
if (!Symbol.asyncIterator)
|
|
360
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
361
|
-
var m = o[Symbol.asyncIterator], i;
|
|
362
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
363
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
364
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
365
|
-
}
|
|
366
|
-
function __makeTemplateObject(cooked, raw) {
|
|
367
|
-
if (Object.defineProperty) {
|
|
368
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
cooked.raw = raw;
|
|
372
|
-
}
|
|
373
|
-
return cooked;
|
|
374
|
-
}
|
|
375
|
-
;
|
|
376
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
377
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
378
|
-
}) : function (o, v) {
|
|
379
|
-
o["default"] = v;
|
|
380
|
-
};
|
|
381
|
-
function __importStar(mod) {
|
|
382
|
-
if (mod && mod.__esModule)
|
|
383
|
-
return mod;
|
|
384
|
-
var result = {};
|
|
385
|
-
if (mod != null)
|
|
386
|
-
for (var k in mod)
|
|
387
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
388
|
-
__createBinding(result, mod, k);
|
|
389
|
-
__setModuleDefault(result, mod);
|
|
390
|
-
return result;
|
|
391
|
-
}
|
|
392
|
-
function __importDefault(mod) {
|
|
393
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
394
|
-
}
|
|
395
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
396
|
-
if (kind === "a" && !f)
|
|
397
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
398
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
399
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
400
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
401
|
-
}
|
|
402
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
403
|
-
if (kind === "m")
|
|
404
|
-
throw new TypeError("Private method is not writable");
|
|
405
|
-
if (kind === "a" && !f)
|
|
406
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
407
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
408
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
409
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
var daffGeographyInitialState = {
|
|
413
|
-
loading: false,
|
|
414
|
-
errors: [],
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
function daffGeographyReducer(state, action) {
|
|
418
|
-
if (state === void 0) { state = daffGeographyInitialState; }
|
|
419
|
-
switch (action.type) {
|
|
420
|
-
case exports.DaffGeographyActionTypes.CountryLoadAction:
|
|
421
|
-
case exports.DaffGeographyActionTypes.CountryListAction:
|
|
422
|
-
return Object.assign(Object.assign({}, state), { loading: true });
|
|
423
|
-
case exports.DaffGeographyActionTypes.CountryLoadSuccessAction:
|
|
424
|
-
case exports.DaffGeographyActionTypes.CountryListSuccessAction:
|
|
425
|
-
return Object.assign(Object.assign({}, state), { errors: [], loading: false });
|
|
426
|
-
case exports.DaffGeographyActionTypes.CountryLoadFailureAction:
|
|
427
|
-
case exports.DaffGeographyActionTypes.CountryListFailureAction:
|
|
428
|
-
return Object.assign(Object.assign({}, state), { errors: __spread(state.errors, [
|
|
429
|
-
action.payload,
|
|
430
|
-
]), loading: false });
|
|
431
|
-
default:
|
|
432
|
-
return state;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
var daffGeographyReducers = {
|
|
437
|
-
geography: daffGeographyReducer,
|
|
438
|
-
countries: daffCountryEntitiesReducer,
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
var DAFF_GEOGRAPHY_STORE_FEATURE_KEY = 'daffGeography';
|
|
442
|
-
|
|
443
|
-
var ɵ0$1 = function () {
|
|
444
|
-
var cache;
|
|
445
|
-
return function () { return cache = cache || {
|
|
446
|
-
selectGeographyFeatureState: i1.createFeatureSelector(DAFF_GEOGRAPHY_STORE_FEATURE_KEY),
|
|
447
|
-
}; };
|
|
448
|
-
};
|
|
449
|
-
var getDaffGeographyFeatureStateSelector = (ɵ0$1)();
|
|
450
|
-
|
|
451
|
-
var createCountryEntitySelectors = function () {
|
|
452
|
-
var selectGeographyFeatureState = getDaffGeographyFeatureStateSelector().selectGeographyFeatureState;
|
|
453
|
-
var selectCountryEntitiesState = i1.createSelector(selectGeographyFeatureState, function (state) { return state.countries; });
|
|
454
|
-
var _a = getCountryAdapter().getSelectors(selectCountryEntitiesState), selectIds = _a.selectIds, selectEntities = _a.selectEntities, selectAll = _a.selectAll, selectTotal = _a.selectTotal;
|
|
455
|
-
var selectCountry = i1.defaultMemoize(function (countryId) { return i1.createSelector(selectEntities, function (countries) { return countries[countryId]; }); }).memoized;
|
|
456
|
-
var selectCountrySubdivisions = i1.defaultMemoize(function (countryId) { return i1.createSelector(selectCountry(countryId), function (country) { return (country === null || country === void 0 ? void 0 : country.subdivisions) || []; }); }).memoized;
|
|
457
|
-
var selectIsCountryFullyLoaded = i1.defaultMemoize(function (countryId) { return i1.createSelector(selectCountry(countryId), function (country) { return country === null || country === void 0 ? void 0 : country.loaded; }); }).memoized;
|
|
458
|
-
return {
|
|
459
|
-
selectCountryEntitiesState: selectCountryEntitiesState,
|
|
460
|
-
/**
|
|
461
|
-
* Selector for country IDs.
|
|
462
|
-
*/
|
|
463
|
-
selectCountryIds: selectIds,
|
|
464
|
-
/**
|
|
465
|
-
* Selector for country entities.
|
|
466
|
-
*/
|
|
467
|
-
selectCountryEntities: selectEntities,
|
|
468
|
-
/**
|
|
469
|
-
* Selector for all countries.
|
|
470
|
-
*/
|
|
471
|
-
selectAllCountries: selectAll,
|
|
472
|
-
/**
|
|
473
|
-
* Selector for total number of countries.
|
|
474
|
-
*/
|
|
475
|
-
selectCountryTotal: selectTotal,
|
|
476
|
-
/**
|
|
477
|
-
* Selector for a specific country.
|
|
478
|
-
*/
|
|
479
|
-
selectCountry: selectCountry,
|
|
480
|
-
/**
|
|
481
|
-
* Selector for a specific country's subdivisions.
|
|
482
|
-
*/
|
|
483
|
-
selectCountrySubdivisions: selectCountrySubdivisions,
|
|
484
|
-
/**
|
|
485
|
-
* Selector for checking if a country has been fully loaded.
|
|
486
|
-
* If true, then a country's subdivisions will be populated if any exist.
|
|
487
|
-
*/
|
|
488
|
-
selectIsCountryFullyLoaded: selectIsCountryFullyLoaded,
|
|
489
|
-
};
|
|
490
|
-
};
|
|
491
|
-
var ɵ0$2 = createCountryEntitySelectors;
|
|
492
|
-
var ɵ1 = function () {
|
|
493
|
-
var cache;
|
|
494
|
-
return function () { return cache = cache || createCountryEntitySelectors(); };
|
|
495
|
-
};
|
|
496
|
-
var getDaffCountryEntitySelectors = (ɵ1)();
|
|
497
|
-
|
|
498
|
-
var createGeographySelectors = function () {
|
|
499
|
-
var selectGeographyFeatureState = getDaffGeographyFeatureStateSelector().selectGeographyFeatureState;
|
|
500
|
-
var selectGeographyState = i1.createSelector(selectGeographyFeatureState, function (state) { return state.geography; });
|
|
501
|
-
var selectGeographyLoading = i1.createSelector(selectGeographyState, function (state) { return state.loading; });
|
|
502
|
-
var selectGeographyErrors = i1.createSelector(selectGeographyState, function (state) { return state.errors; });
|
|
503
|
-
return {
|
|
504
|
-
selectGeographyState: selectGeographyState,
|
|
505
|
-
selectGeographyLoading: selectGeographyLoading,
|
|
506
|
-
selectGeographyErrors: selectGeographyErrors,
|
|
507
|
-
};
|
|
508
|
-
};
|
|
509
|
-
var ɵ0$3 = createGeographySelectors;
|
|
510
|
-
var ɵ1$1 = function () {
|
|
511
|
-
var cache;
|
|
512
|
-
return function () { return cache = cache || createGeographySelectors(); };
|
|
513
|
-
};
|
|
514
|
-
var getGeographySelectors = (ɵ1$1)();
|
|
515
|
-
|
|
516
|
-
var ɵ0$4 = function () {
|
|
517
|
-
var cache;
|
|
518
|
-
return function () { return cache = cache || Object.assign(Object.assign(Object.assign({}, getGeographySelectors()), getDaffCountryEntitySelectors()), getDaffGeographyFeatureStateSelector()); };
|
|
519
|
-
};
|
|
520
|
-
var getDaffGeographySelectors = (ɵ0$4)();
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* @inheritdoc
|
|
524
|
-
*/
|
|
525
|
-
var DaffGeographyFacade = /** @class */ (function () {
|
|
526
|
-
function DaffGeographyFacade(store) {
|
|
527
|
-
this.store = store;
|
|
528
|
-
var _a = getDaffGeographySelectors(), selectCountryIds = _a.selectCountryIds, selectCountryEntities = _a.selectCountryEntities, selectAllCountries = _a.selectAllCountries, selectCountryTotal = _a.selectCountryTotal, selectGeographyLoading = _a.selectGeographyLoading, selectGeographyErrors = _a.selectGeographyErrors, selectCountry = _a.selectCountry, selectCountrySubdivisions = _a.selectCountrySubdivisions, selectIsCountryFullyLoaded = _a.selectIsCountryFullyLoaded;
|
|
529
|
-
this._selectCountry = selectCountry;
|
|
530
|
-
this._selectCountrySubdivisions = selectCountrySubdivisions;
|
|
531
|
-
this._selectIsCountryFullyLoaded = selectIsCountryFullyLoaded;
|
|
532
|
-
this.loading$ = this.store.pipe(i1.select(selectGeographyLoading));
|
|
533
|
-
this.errors$ = this.store.pipe(i1.select(selectGeographyErrors));
|
|
534
|
-
this.countries$ = this.store.pipe(i1.select(selectAllCountries));
|
|
535
|
-
this.countryIds$ = this.store.pipe(i1.select(selectCountryIds));
|
|
536
|
-
this.countryCount$ = this.store.pipe(i1.select(selectCountryTotal));
|
|
537
|
-
this.countryEntities$ = this.store.pipe(i1.select(selectCountryEntities));
|
|
538
|
-
}
|
|
539
|
-
DaffGeographyFacade.prototype.getCountry = function (id) {
|
|
540
|
-
return this.store.pipe(i1.select(this._selectCountry(id)));
|
|
541
|
-
};
|
|
542
|
-
DaffGeographyFacade.prototype.getCountrySubdivisions = function (id) {
|
|
543
|
-
return this.store.pipe(i1.select(this._selectCountrySubdivisions(id)));
|
|
544
|
-
};
|
|
545
|
-
DaffGeographyFacade.prototype.isCountryFullyLoaded = function (id) {
|
|
546
|
-
return this.store.pipe(i1.select(this._selectIsCountryFullyLoaded(id)));
|
|
547
|
-
};
|
|
548
|
-
DaffGeographyFacade.prototype.dispatch = function (action) {
|
|
549
|
-
this.store.dispatch(action);
|
|
550
|
-
};
|
|
551
|
-
return DaffGeographyFacade;
|
|
552
|
-
}());
|
|
553
|
-
/** @nocollapse */ DaffGeographyFacade.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffGeographyFacade_Factory() { return new DaffGeographyFacade(i0.ɵɵinject(i1.Store)); }, token: DaffGeographyFacade, providedIn: "root" });
|
|
554
|
-
DaffGeographyFacade.decorators = [
|
|
555
|
-
{ type: i0.Injectable, args: [{
|
|
556
|
-
providedIn: 'root',
|
|
557
|
-
},] }
|
|
558
|
-
];
|
|
559
|
-
/** @nocollapse */
|
|
560
|
-
DaffGeographyFacade.ctorParameters = function () { return [
|
|
561
|
-
{ type: i1.Store }
|
|
562
|
-
]; };
|
|
563
|
-
|
|
564
|
-
var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
565
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
566
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
567
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
568
|
-
else
|
|
569
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
570
|
-
if (d = decorators[i])
|
|
571
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
572
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
573
|
-
};
|
|
574
|
-
var __metadata$1 = (this && this.__metadata) || function (k, v) {
|
|
575
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
576
|
-
return Reflect.metadata(k, v);
|
|
577
|
-
};
|
|
578
|
-
var DaffGeographyEffects = /** @class */ (function () {
|
|
579
|
-
function DaffGeographyEffects(actions$, driver, errorMatcher) {
|
|
580
|
-
var _this = this;
|
|
581
|
-
this.actions$ = actions$;
|
|
582
|
-
this.driver = driver;
|
|
583
|
-
this.errorMatcher = errorMatcher;
|
|
584
|
-
this.get$ = this.actions$.pipe(effects.ofType(exports.DaffGeographyActionTypes.CountryLoadAction), operators.switchMap(function (action) { return _this.driver.get(action.payload).pipe(operators.map(function (resp) { return new DaffCountryLoadSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffCountryLoadFailure(_this.errorMatcher(error))); })); }));
|
|
585
|
-
this.list$ = this.actions$.pipe(effects.ofType(exports.DaffGeographyActionTypes.CountryListAction), operators.switchMap(function (action) { return _this.driver.list().pipe(operators.map(function (resp) { return new DaffCountryListSuccess(resp); }), operators.catchError(function (error) { return rxjs.of(new DaffCountryListFailure(_this.errorMatcher(error))); })); }));
|
|
586
|
-
}
|
|
587
|
-
return DaffGeographyEffects;
|
|
588
|
-
}());
|
|
589
|
-
DaffGeographyEffects.decorators = [
|
|
590
|
-
{ type: i0.Injectable }
|
|
591
|
-
];
|
|
592
|
-
/** @nocollapse */
|
|
593
|
-
DaffGeographyEffects.ctorParameters = function () { return [
|
|
594
|
-
{ type: effects.Actions },
|
|
595
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [driver.DaffGeographyDriver,] }] },
|
|
596
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [geography.DAFF_GEOGRAPHY_ERROR_MATCHER,] }] }
|
|
597
|
-
]; };
|
|
598
|
-
__decorate$1([
|
|
599
|
-
effects.Effect(),
|
|
600
|
-
__metadata$1("design:type", Object)
|
|
601
|
-
], DaffGeographyEffects.prototype, "get$", void 0);
|
|
602
|
-
__decorate$1([
|
|
603
|
-
effects.Effect(),
|
|
604
|
-
__metadata$1("design:type", Object)
|
|
605
|
-
], DaffGeographyEffects.prototype, "list$", void 0);
|
|
606
|
-
|
|
607
|
-
var DaffGeographyStateModule = /** @class */ (function () {
|
|
608
|
-
function DaffGeographyStateModule() {
|
|
609
|
-
}
|
|
610
|
-
return DaffGeographyStateModule;
|
|
611
|
-
}());
|
|
612
|
-
DaffGeographyStateModule.decorators = [
|
|
613
|
-
{ type: i0.NgModule, args: [{
|
|
614
|
-
imports: [
|
|
615
|
-
i1.StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),
|
|
616
|
-
effects.EffectsModule.forFeature([
|
|
617
|
-
DaffGeographyEffects,
|
|
618
|
-
]),
|
|
619
|
-
],
|
|
620
|
-
},] }
|
|
621
|
-
];
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* Generated bundle index. Do not edit.
|
|
625
|
-
*/
|
|
626
|
-
|
|
627
|
-
exports.DAFF_GEOGRAPHY_STORE_FEATURE_KEY = DAFF_GEOGRAPHY_STORE_FEATURE_KEY;
|
|
628
|
-
exports.DaffCountryList = DaffCountryList;
|
|
629
|
-
exports.DaffCountryListFailure = DaffCountryListFailure;
|
|
630
|
-
exports.DaffCountryListSuccess = DaffCountryListSuccess;
|
|
631
|
-
exports.DaffCountryLoad = DaffCountryLoad;
|
|
632
|
-
exports.DaffCountryLoadFailure = DaffCountryLoadFailure;
|
|
633
|
-
exports.DaffCountryLoadSuccess = DaffCountryLoadSuccess;
|
|
634
|
-
exports.DaffGeographyFacade = DaffGeographyFacade;
|
|
635
|
-
exports.DaffGeographyStateModule = DaffGeographyStateModule;
|
|
636
|
-
exports.daffCountryEntitiesInitialState = daffCountryEntitiesInitialState;
|
|
637
|
-
exports.daffCountryEntitiesReducer = daffCountryEntitiesReducer;
|
|
638
|
-
exports.daffGeographyInitialState = daffGeographyInitialState;
|
|
639
|
-
exports.daffGeographyReducer = daffGeographyReducer;
|
|
640
|
-
exports.daffGeographyReducers = daffGeographyReducers;
|
|
641
|
-
exports.getCountryAdapter = getCountryAdapter;
|
|
642
|
-
exports.getDaffGeographySelectors = getDaffGeographySelectors;
|
|
643
|
-
exports.ɵ0 = ɵ0$4;
|
|
644
|
-
exports.ɵa = DaffGeographyEffects;
|
|
645
|
-
|
|
646
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
647
|
-
|
|
648
|
-
})));
|
|
649
|
-
//# sourceMappingURL=daffodil-geography-state.umd.js.map
|