@kaspernj/api-maker 1.0.2054 → 1.0.2055
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/build/api.js +64 -212
- package/build/api.js.map +1 -1
- package/build/attribute-not-loaded-error.js +2 -25
- package/build/attribute-not-loaded-error.js.map +1 -1
- package/build/base-component.js +3 -26
- package/build/base-component.js.map +1 -1
- package/build/base-error.js +20 -45
- package/build/base-error.js.map +1 -1
- package/build/base-model/attribute.js +14 -21
- package/build/base-model/attribute.js.map +1 -1
- package/build/base-model/column.js +4 -8
- package/build/base-model/column.js.map +1 -1
- package/build/base-model/reflection.js +11 -51
- package/build/base-model/reflection.js.map +1 -1
- package/build/base-model/scope.js +8 -45
- package/build/base-model/scope.js.map +1 -1
- package/build/base-model.js +583 -836
- package/build/base-model.js.map +1 -1
- package/build/bootstrap/attribute-row.js +87 -172
- package/build/bootstrap/attribute-row.js.map +1 -1
- package/build/bootstrap/attribute-rows.js +21 -50
- package/build/bootstrap/attribute-rows.js.map +1 -1
- package/build/bootstrap/card.js +76 -159
- package/build/bootstrap/card.js.map +1 -1
- package/build/bootstrap/checkbox.js +53 -102
- package/build/bootstrap/checkbox.js.map +1 -1
- package/build/bootstrap/checkboxes.js +116 -202
- package/build/bootstrap/checkboxes.js.map +1 -1
- package/build/bootstrap/input.js +80 -131
- package/build/bootstrap/input.js.map +1 -1
- package/build/bootstrap/invalid-feedback.js +18 -46
- package/build/bootstrap/invalid-feedback.js.map +1 -1
- package/build/bootstrap/paginate.js +99 -164
- package/build/bootstrap/paginate.js.map +1 -1
- package/build/bootstrap/radio-buttons.js +43 -80
- package/build/bootstrap/radio-buttons.js.map +1 -1
- package/build/bootstrap/select.js +43 -90
- package/build/bootstrap/select.js.map +1 -1
- package/build/bootstrap/sort-link.js +68 -151
- package/build/bootstrap/sort-link.js.map +1 -1
- package/build/cable-connection-pool.js +43 -65
- package/build/cable-connection-pool.js.map +1 -1
- package/build/cable-subscription-pool.js +104 -161
- package/build/cable-subscription-pool.js.map +1 -1
- package/build/cable-subscription.js +9 -16
- package/build/cable-subscription.js.map +1 -1
- package/build/cache-key-generator.js +27 -36
- package/build/cache-key-generator.js.map +1 -1
- package/build/can-can.js +80 -201
- package/build/can-can.js.map +1 -1
- package/build/channels-consumer.js +5 -10
- package/build/channels-consumer.js.map +1 -1
- package/build/collection-loader.js +35 -53
- package/build/collection-loader.js.map +1 -1
- package/build/collection.js +160 -307
- package/build/collection.js.map +1 -1
- package/build/command-submit-data.d.ts +1 -1
- package/build/command-submit-data.d.ts.map +1 -1
- package/build/command-submit-data.js +29 -38
- package/build/command-submit-data.js.map +1 -1
- package/build/commands-pool.js +139 -215
- package/build/commands-pool.js.map +1 -1
- package/build/compose.js +3 -11
- package/build/compose.js.map +1 -1
- package/build/config.js +20 -67
- package/build/config.js.map +1 -1
- package/build/custom-error.js +4 -29
- package/build/custom-error.js.map +1 -1
- package/build/data-set-to-attributes.js +5 -41
- package/build/data-set-to-attributes.js.map +1 -1
- package/build/deserializer.js +26 -79
- package/build/deserializer.js.map +1 -1
- package/build/destroy-error.js +4 -29
- package/build/destroy-error.js.map +1 -1
- package/build/devise.js +83 -187
- package/build/devise.js.map +1 -1
- package/build/draggable-sort/controller.js +87 -110
- package/build/draggable-sort/controller.js.map +1 -1
- package/build/draggable-sort/index.js +67 -144
- package/build/draggable-sort/index.js.map +1 -1
- package/build/draggable-sort/item.js +131 -197
- package/build/draggable-sort/item.js.map +1 -1
- package/build/error-logger.js +78 -163
- package/build/error-logger.js.map +1 -1
- package/build/error-messages.js +4 -7
- package/build/error-messages.js.map +1 -1
- package/build/event-connection.js +23 -61
- package/build/event-connection.js.map +1 -1
- package/build/event-emitter-listener.js +6 -23
- package/build/event-emitter-listener.js.map +1 -1
- package/build/event-model-class.js +19 -46
- package/build/event-model-class.js.map +1 -1
- package/build/events.js +3 -8
- package/build/events.js.map +1 -1
- package/build/form.js +65 -153
- package/build/form.js.map +1 -1
- package/build/history-expo.js +12 -24
- package/build/history-expo.js.map +1 -1
- package/build/history-react-native.js +14 -26
- package/build/history-react-native.js.map +1 -1
- package/build/history.js +2 -4
- package/build/history.js.map +1 -1
- package/build/index.js +2 -5
- package/build/index.js.map +1 -1
- package/build/inputs/attachment.js +71 -122
- package/build/inputs/attachment.js.map +1 -1
- package/build/inputs/auto-submit.js +15 -54
- package/build/inputs/auto-submit.js.map +1 -1
- package/build/inputs/checkbox.js +77 -166
- package/build/inputs/checkbox.js.map +1 -1
- package/build/inputs/checkboxes.js +75 -158
- package/build/inputs/checkboxes.js.map +1 -1
- package/build/inputs/id-for-component.js +4 -40
- package/build/inputs/id-for-component.js.map +1 -1
- package/build/inputs/input-wrapper.js +7 -26
- package/build/inputs/input-wrapper.js.map +1 -1
- package/build/inputs/input.js +158 -244
- package/build/inputs/input.js.map +1 -1
- package/build/inputs/money.js +123 -185
- package/build/inputs/money.js.map +1 -1
- package/build/inputs/name-for-component.js +4 -40
- package/build/inputs/name-for-component.js.map +1 -1
- package/build/inputs/select.js +68 -122
- package/build/inputs/select.js.map +1 -1
- package/build/instance-of-class-name.js +15 -20
- package/build/instance-of-class-name.js.map +1 -1
- package/build/is-expo.js +8 -10
- package/build/is-expo.js.map +1 -1
- package/build/key-value-store.js +51 -127
- package/build/key-value-store.js.map +1 -1
- package/build/link.js +51 -114
- package/build/link.js.map +1 -1
- package/build/logger.js +19 -25
- package/build/logger.js.map +1 -1
- package/build/merge-styles.js +5 -9
- package/build/merge-styles.js.map +1 -1
- package/build/modal.js +14 -61
- package/build/modal.js.map +1 -1
- package/build/model-class-require.js +8 -43
- package/build/model-class-require.js.map +1 -1
- package/build/model-events.js +24 -33
- package/build/model-events.js.map +1 -1
- package/build/model-name.js +15 -56
- package/build/model-name.js.map +1 -1
- package/build/model-prop-type.js +51 -62
- package/build/model-prop-type.js.map +1 -1
- package/build/model-recipes-loader.js +16 -24
- package/build/model-recipes-loader.js.map +1 -1
- package/build/model-recipes-model-loader.d.ts +1 -1
- package/build/model-recipes-model-loader.js +129 -207
- package/build/model-recipes-model-loader.js.map +1 -1
- package/build/models-response-reader.js +24 -65
- package/build/models-response-reader.js.map +1 -1
- package/build/models.js +5 -10
- package/build/models.js.map +1 -1
- package/build/money-formatter.d.ts +2 -2
- package/build/money-formatter.d.ts.map +1 -1
- package/build/money-formatter.js +45 -55
- package/build/money-formatter.js.map +1 -1
- package/build/not-loaded-error.js +2 -25
- package/build/not-loaded-error.js.map +1 -1
- package/build/params.js +31 -41
- package/build/params.js.map +1 -1
- package/build/preloaded.js +18 -58
- package/build/preloaded.js.map +1 -1
- package/build/resize-observer.js +5 -11
- package/build/resize-observer.js.map +1 -1
- package/build/rest-props-validator.js +4 -6
- package/build/rest-props-validator.js.map +1 -1
- package/build/result.js +10 -14
- package/build/result.js.map +1 -1
- package/build/router/route.js +178 -311
- package/build/router/route.js.map +1 -1
- package/build/router/switch.js +55 -129
- package/build/router/switch.js.map +1 -1
- package/build/router.js +33 -93
- package/build/router.js.map +1 -1
- package/build/routes-native.js +63 -147
- package/build/routes-native.js.map +1 -1
- package/build/routes.js +25 -79
- package/build/routes.js.map +1 -1
- package/build/run-last.js +19 -24
- package/build/run-last.js.map +1 -1
- package/build/serializer.js +28 -33
- package/build/serializer.js.map +1 -1
- package/build/services.js +9 -18
- package/build/services.js.map +1 -1
- package/build/session-status-updater.js +84 -183
- package/build/session-status-updater.js.map +1 -1
- package/build/source-maps-loader.d.ts +37 -0
- package/build/source-maps-loader.d.ts.map +1 -0
- package/build/source-maps-loader.js +102 -224
- package/build/source-maps-loader.js.map +1 -1
- package/build/super-admin/config-reader.d.ts +2 -2
- package/build/super-admin/config-reader.js +41 -82
- package/build/super-admin/config-reader.js.map +1 -1
- package/build/super-admin/edit-page/edit-attribute-checkbox.js +52 -114
- package/build/super-admin/edit-page/edit-attribute-checkbox.js.map +1 -1
- package/build/super-admin/edit-page/edit-attribute-content.js +46 -76
- package/build/super-admin/edit-page/edit-attribute-content.js.map +1 -1
- package/build/super-admin/edit-page/edit-attribute-input.js +56 -118
- package/build/super-admin/edit-page/edit-attribute-input.js.map +1 -1
- package/build/super-admin/edit-page/edit-attribute.js +39 -103
- package/build/super-admin/edit-page/edit-attribute.js.map +1 -1
- package/build/super-admin/edit-page.js +87 -200
- package/build/super-admin/edit-page.js.map +1 -1
- package/build/super-admin/has-edit-config.js +6 -12
- package/build/super-admin/has-edit-config.js.map +1 -1
- package/build/super-admin/index-page.js +16 -43
- package/build/super-admin/index-page.js.map +1 -1
- package/build/super-admin/index.js +86 -209
- package/build/super-admin/index.js.map +1 -1
- package/build/super-admin/layout/header/index.js +90 -151
- package/build/super-admin/layout/header/index.js.map +1 -1
- package/build/super-admin/layout/index.js +69 -152
- package/build/super-admin/layout/index.js.map +1 -1
- package/build/super-admin/layout/menu/index.js +84 -160
- package/build/super-admin/layout/menu/index.js.map +1 -1
- package/build/super-admin/layout/menu/menu-content.js +24 -84
- package/build/super-admin/layout/menu/menu-content.js.map +1 -1
- package/build/super-admin/layout/menu/menu-item.js +51 -101
- package/build/super-admin/layout/menu/menu-item.js.map +1 -1
- package/build/super-admin/layout/no-access.js +18 -44
- package/build/super-admin/layout/no-access.js.map +1 -1
- package/build/super-admin/model-class-table.js +44 -128
- package/build/super-admin/model-class-table.js.map +1 -1
- package/build/super-admin/models.js +5 -41
- package/build/super-admin/models.js.map +1 -1
- package/build/super-admin/show-nav.js +26 -88
- package/build/super-admin/show-nav.js.map +1 -1
- package/build/super-admin/show-page/belongs-to-attribute-row.js +17 -75
- package/build/super-admin/show-page/belongs-to-attribute-row.js.map +1 -1
- package/build/super-admin/show-page/index.js +100 -186
- package/build/super-admin/show-page/index.js.map +1 -1
- package/build/super-admin/show-reflection-actions.js +38 -99
- package/build/super-admin/show-reflection-actions.js.map +1 -1
- package/build/super-admin/show-reflection-link.js +26 -98
- package/build/super-admin/show-reflection-link.js.map +1 -1
- package/build/super-admin/show-reflection-page.js +33 -96
- package/build/super-admin/show-reflection-page.js.map +1 -1
- package/build/table/column-content.js +76 -120
- package/build/table/column-content.js.map +1 -1
- package/build/table/column-identifier.js +6 -10
- package/build/table/column-identifier.js.map +1 -1
- package/build/table/column-visible.js +1 -4
- package/build/table/column-visible.js.map +1 -1
- package/build/table/components/column.js +12 -59
- package/build/table/components/column.js.map +1 -1
- package/build/table/components/flat-list.js +12 -59
- package/build/table/components/flat-list.js.map +1 -1
- package/build/table/components/header.js +14 -61
- package/build/table/components/header.js.map +1 -1
- package/build/table/components/row.js +15 -62
- package/build/table/components/row.js.map +1 -1
- package/build/table/filters/attribute-element.js +33 -61
- package/build/table/filters/attribute-element.js.map +1 -1
- package/build/table/filters/filter-form.js +279 -482
- package/build/table/filters/filter-form.js.map +1 -1
- package/build/table/filters/filter.js +44 -72
- package/build/table/filters/filter.js.map +1 -1
- package/build/table/filters/index.js +94 -138
- package/build/table/filters/index.js.map +1 -1
- package/build/table/filters/load-search-modal.js +63 -211
- package/build/table/filters/load-search-modal.js.map +1 -1
- package/build/table/filters/reflection-element.js +26 -54
- package/build/table/filters/reflection-element.js.map +1 -1
- package/build/table/filters/save-search-modal.js +43 -139
- package/build/table/filters/save-search-modal.js.map +1 -1
- package/build/table/filters/scope-element.js +27 -55
- package/build/table/filters/scope-element.js.map +1 -1
- package/build/table/header-column-content.js +32 -70
- package/build/table/header-column-content.js.map +1 -1
- package/build/table/header-column.js +88 -217
- package/build/table/header-column.js.map +1 -1
- package/build/table/header-select.js +44 -76
- package/build/table/header-select.js.map +1 -1
- package/build/table/model-callback-args.js +4 -40
- package/build/table/model-callback-args.js.map +1 -1
- package/build/table/model-column.js +58 -143
- package/build/table/model-column.js.map +1 -1
- package/build/table/model-row.js +74 -186
- package/build/table/model-row.js.map +1 -1
- package/build/table/select-calculator.js +26 -85
- package/build/table/select-calculator.js.map +1 -1
- package/build/table/settings/column-row.js +65 -185
- package/build/table/settings/column-row.js.map +1 -1
- package/build/table/settings/download-action.js +37 -73
- package/build/table/settings/download-action.js.map +1 -1
- package/build/table/settings/index.js +37 -101
- package/build/table/settings/index.js.map +1 -1
- package/build/table/table-settings.js +184 -322
- package/build/table/table-settings.js.map +1 -1
- package/build/table/table.js +582 -780
- package/build/table/table.js.map +1 -1
- package/build/table/use-sorting.js +15 -34
- package/build/table/use-sorting.js.map +1 -1
- package/build/table/widths.js +31 -37
- package/build/table/widths.js.map +1 -1
- package/build/table/worker-plugins-check-all-checkbox.js +76 -224
- package/build/table/worker-plugins-check-all-checkbox.js.map +1 -1
- package/build/table/worker-plugins-checkbox.js +73 -184
- package/build/table/worker-plugins-checkbox.js.map +1 -1
- package/build/translated-attributes.js +5 -10
- package/build/translated-attributes.js.map +1 -1
- package/build/translated-collections.js +10 -19
- package/build/translated-collections.js.map +1 -1
- package/build/updated-attribute.js +46 -119
- package/build/updated-attribute.js.map +1 -1
- package/build/url-encode.js +5 -11
- package/build/url-encode.js.map +1 -1
- package/build/use-breakpoint.js +42 -94
- package/build/use-breakpoint.js.map +1 -1
- package/build/use-can-can.js +29 -91
- package/build/use-can-can.js.map +1 -1
- package/build/use-collection.js +118 -228
- package/build/use-collection.js.map +1 -1
- package/build/use-created-event.js +26 -43
- package/build/use-created-event.js.map +1 -1
- package/build/use-current-user-context.js +56 -150
- package/build/use-current-user-context.js.map +1 -1
- package/build/use-current-user.js +13 -31
- package/build/use-current-user.js.map +1 -1
- package/build/use-destroyed-event.js +21 -42
- package/build/use-destroyed-event.js.map +1 -1
- package/build/use-event-emitter.js +9 -14
- package/build/use-event-emitter.js.map +1 -1
- package/build/use-event-listener.js +12 -21
- package/build/use-event-listener.js.map +1 -1
- package/build/use-input.js +48 -68
- package/build/use-input.js.map +1 -1
- package/build/use-model-event.js +21 -42
- package/build/use-model-event.js.map +1 -1
- package/build/use-model.js +95 -198
- package/build/use-model.js.map +1 -1
- package/build/use-resize-observer.js +10 -20
- package/build/use-resize-observer.js.map +1 -1
- package/build/use-router.js +64 -106
- package/build/use-router.js.map +1 -1
- package/build/use-screen-layout.js +16 -18
- package/build/use-screen-layout.js.map +1 -1
- package/build/use-styles.js +23 -74
- package/build/use-styles.js.map +1 -1
- package/build/use-updated-event.js +21 -43
- package/build/use-updated-event.js.map +1 -1
- package/build/use-validation-errors.js +11 -17
- package/build/use-validation-errors.js.map +1 -1
- package/build/utils/button.js +85 -135
- package/build/utils/button.js.map +1 -1
- package/build/utils/card.js +30 -105
- package/build/utils/card.js.map +1 -1
- package/build/utils/checkbox.js +50 -111
- package/build/utils/checkbox.js.map +1 -1
- package/build/utils/checkboxes.js +108 -181
- package/build/utils/checkboxes.js.map +1 -1
- package/build/utils/default-style.js +28 -102
- package/build/utils/default-style.js.map +1 -1
- package/build/utils/header.js +7 -34
- package/build/utils/header.js.map +1 -1
- package/build/utils/icon.js +35 -116
- package/build/utils/icon.js.map +1 -1
- package/build/utils/invalid-feedback.js +15 -42
- package/build/utils/invalid-feedback.js.map +1 -1
- package/build/utils/modal.js +24 -107
- package/build/utils/modal.js.map +1 -1
- package/build/utils/text.js +9 -36
- package/build/utils/text.js.map +1 -1
- package/build/validation-error.js +30 -88
- package/build/validation-error.js.map +1 -1
- package/build/validation-errors.js +60 -110
- package/build/validation-errors.js.map +1 -1
- package/build/with-api-maker.js +14 -66
- package/build/with-api-maker.js.map +1 -1
- package/build/with-collection.js +13 -63
- package/build/with-collection.js.map +1 -1
- package/build/with-current-user.js +6 -22
- package/build/with-current-user.js.map +1 -1
- package/build/with-model.js +10 -26
- package/build/with-model.js.map +1 -1
- package/build/with-router.js +7 -34
- package/build/with-router.js.map +1 -1
- package/package.json +1 -1
package/build/error-logger.js
CHANGED
|
@@ -1,187 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
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) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
-
if (ar || !(i in from)) {
|
|
41
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
-
ar[i] = from[i];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
-
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
var diggerize_1 = require("diggerize");
|
|
52
|
-
var source_maps_loader_js_1 = __importDefault(require("./source-maps-loader.js"));
|
|
53
|
-
var ErrorLogger = /** @class */ (function () {
|
|
54
|
-
function ErrorLogger() {
|
|
55
|
-
var _this = this;
|
|
56
|
-
this.getErrors = function () { return _this.errors; };
|
|
57
|
-
this.hasErrorOccurred = function () { return (0, diggerize_1.digg)(_this, "errorOccurred"); };
|
|
58
|
-
this.isLoadingSourceMaps = function () { return (0, diggerize_1.digg)(_this, "sourceMapsLoader", "isLoadingSourceMaps"); };
|
|
59
|
-
this.isWorkingOnError = function () { return (0, diggerize_1.digg)(_this, "isHandlingError") || _this.isLoadingSourceMaps(); };
|
|
1
|
+
import { digg } from "diggerize";
|
|
2
|
+
import SourceMapsLoader from "./source-maps-loader.js";
|
|
3
|
+
export default class ErrorLogger {
|
|
4
|
+
constructor() {
|
|
60
5
|
this.debugging = false;
|
|
61
6
|
this.errorOccurred = false;
|
|
62
7
|
this.errors = [];
|
|
63
8
|
this.isHandlingError = false;
|
|
64
|
-
this.sourceMapsLoader = new
|
|
65
|
-
this.sourceMapsLoader.loadSourceMapsForScriptTags(
|
|
66
|
-
|
|
67
|
-
|
|
9
|
+
this.sourceMapsLoader = new SourceMapsLoader();
|
|
10
|
+
this.sourceMapsLoader.loadSourceMapsForScriptTags((script) => {
|
|
11
|
+
const src = script.getAttribute("src");
|
|
12
|
+
const type = script.getAttribute("type");
|
|
68
13
|
if (src && (src.includes("/packs/") || src.includes("/packs-test/")) && (type == "text/javascript" || !type)) {
|
|
69
14
|
return src;
|
|
70
15
|
}
|
|
71
16
|
});
|
|
72
17
|
}
|
|
73
|
-
|
|
74
|
-
var output = [];
|
|
75
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
76
|
-
output[_i] = arguments[_i];
|
|
77
|
-
}
|
|
18
|
+
debug(...output) {
|
|
78
19
|
if (this.debugging)
|
|
79
|
-
console.error
|
|
80
|
-
}
|
|
81
|
-
|
|
20
|
+
console.error(`ApiMaker ErrorLogger:`, ...output);
|
|
21
|
+
}
|
|
22
|
+
enable() {
|
|
82
23
|
this.debug("Enable called");
|
|
83
24
|
this.connectOnError();
|
|
84
25
|
this.connectUnhandledRejection();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
26
|
+
}
|
|
27
|
+
getErrors = () => this.errors;
|
|
28
|
+
hasErrorOccurred = () => digg(this, "errorOccurred");
|
|
29
|
+
isLoadingSourceMaps = () => digg(this, "sourceMapsLoader", "isLoadingSourceMaps");
|
|
30
|
+
isWorkingOnError = () => digg(this, "isHandlingError") || this.isLoadingSourceMaps();
|
|
31
|
+
connectOnError() {
|
|
32
|
+
window.addEventListener("error", (event) => {
|
|
33
|
+
if (this.debugging)
|
|
34
|
+
this.debug(`Error:`, event.message);
|
|
35
|
+
this.errorOccurred = true;
|
|
36
|
+
if (!this.isHandlingError) {
|
|
37
|
+
this.isHandlingError = true;
|
|
38
|
+
this.onError(event).finally(() => {
|
|
39
|
+
this.isHandlingError = false;
|
|
96
40
|
});
|
|
97
41
|
}
|
|
98
42
|
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
_this.isHandlingError = false;
|
|
43
|
+
}
|
|
44
|
+
connectUnhandledRejection() {
|
|
45
|
+
window.addEventListener("unhandledrejection", (event) => {
|
|
46
|
+
if (this.debugging)
|
|
47
|
+
this.debug(`Unhandled rejection:`, event.reason.message);
|
|
48
|
+
this.errorOccurred = true;
|
|
49
|
+
if (!this.isHandlingError) {
|
|
50
|
+
this.isHandlingError = true;
|
|
51
|
+
this.onUnhandledRejection(event).finally(() => {
|
|
52
|
+
this.isHandlingError = false;
|
|
110
53
|
});
|
|
111
54
|
}
|
|
112
55
|
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
_a.sent();
|
|
125
|
-
_a.label = 2;
|
|
126
|
-
case 2:
|
|
127
|
-
if (event.error && event.error.stack) {
|
|
128
|
-
backtrace = this.sourceMapsLoader.parseStackTrace(event.error.stack);
|
|
129
|
-
this.errors.push({
|
|
130
|
-
errorClass: event.error ? event.error.name : "No error class",
|
|
131
|
-
message: event.message || "Unknown error",
|
|
132
|
-
backtrace: backtrace
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
this.errors.push({
|
|
137
|
-
errorClass: event.error ? event.error.name : "No error class",
|
|
138
|
-
message: event.message || "Unknown error",
|
|
139
|
-
backtrace: null
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
return [2 /*return*/];
|
|
143
|
-
}
|
|
56
|
+
}
|
|
57
|
+
async onError(event) {
|
|
58
|
+
this.errorOccurred = true;
|
|
59
|
+
if (event.error)
|
|
60
|
+
await this.sourceMapsLoader.loadSourceMaps(event.error);
|
|
61
|
+
if (event.error && event.error.stack) {
|
|
62
|
+
const backtrace = this.sourceMapsLoader.parseStackTrace(event.error.stack);
|
|
63
|
+
this.errors.push({
|
|
64
|
+
errorClass: event.error ? event.error.name : "No error class",
|
|
65
|
+
message: event.message || "Unknown error",
|
|
66
|
+
backtrace
|
|
144
67
|
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
switch (_a.label) {
|
|
152
|
-
case 0:
|
|
153
|
-
if (!event.reason) return [3 /*break*/, 2];
|
|
154
|
-
return [4 /*yield*/, this.sourceMapsLoader.loadSourceMaps(event.reason)];
|
|
155
|
-
case 1:
|
|
156
|
-
_a.sent();
|
|
157
|
-
_a.label = 2;
|
|
158
|
-
case 2:
|
|
159
|
-
if (event.reason.stack) {
|
|
160
|
-
backtrace = this.sourceMapsLoader.parseStackTrace(event.reason.stack);
|
|
161
|
-
this.errors.push({
|
|
162
|
-
errorClass: "UnhandledRejection",
|
|
163
|
-
message: event.reason.message || "Unhandled promise rejection",
|
|
164
|
-
backtrace: backtrace
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
this.errors.push({
|
|
169
|
-
errorClass: "UnhandledRejection",
|
|
170
|
-
message: event.reason.message || "Unhandled promise rejection",
|
|
171
|
-
backtrace: null
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
return [2 /*return*/];
|
|
175
|
-
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.errors.push({
|
|
71
|
+
errorClass: event.error ? event.error.name : "No error class",
|
|
72
|
+
message: event.message || "Unknown error",
|
|
73
|
+
backtrace: null
|
|
176
74
|
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async onUnhandledRejection(event) {
|
|
78
|
+
if (event.reason)
|
|
79
|
+
await this.sourceMapsLoader.loadSourceMaps(event.reason);
|
|
80
|
+
if (event.reason.stack) {
|
|
81
|
+
const backtrace = this.sourceMapsLoader.parseStackTrace(event.reason.stack);
|
|
82
|
+
this.errors.push({
|
|
83
|
+
errorClass: "UnhandledRejection",
|
|
84
|
+
message: event.reason.message || "Unhandled promise rejection",
|
|
85
|
+
backtrace
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.errors.push({
|
|
90
|
+
errorClass: "UnhandledRejection",
|
|
91
|
+
message: event.reason.message || "Unhandled promise rejection",
|
|
92
|
+
backtrace: null
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
testPromiseError() {
|
|
97
|
+
return new Promise((_resolve) => {
|
|
181
98
|
throw new Error("testPromiseError");
|
|
182
99
|
});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
}());
|
|
186
|
-
exports.default = ErrorLogger;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
187
102
|
//# sourceMappingURL=error-logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-logger.js","sourceRoot":"/src/","sources":["error-logger.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-logger.js","sourceRoot":"/src/","sources":["error-logger.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,gBAAgB,MAAM,yBAAyB,CAAA;AAEtD,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B;QACE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,IAAI,CA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M,CAAC,OAAO,IAAI,6BAA6B;gBAC9D,SAAS,EAAE,IAAI;aAChB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/build/error-messages.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// @ts-check
|
|
3
|
-
|
|
4
|
-
exports.default = errorMessages;
|
|
5
|
-
var diggerize_1 = require("diggerize");
|
|
2
|
+
import { digg } from "diggerize";
|
|
6
3
|
/**
|
|
7
4
|
* @typedef {Array<string | {message: string}>} ErrorMessagesArgsType
|
|
8
5
|
*/
|
|
@@ -12,13 +9,13 @@ var diggerize_1 = require("diggerize");
|
|
|
12
9
|
* @param {ErrorMessagesArgsType} [args.response.errors]
|
|
13
10
|
* @returns {string[]}
|
|
14
11
|
*/
|
|
15
|
-
function errorMessages(args) {
|
|
12
|
+
export default function errorMessages(args) {
|
|
16
13
|
if (typeof args.response == "object") {
|
|
17
|
-
return
|
|
14
|
+
return digg(args, "response", "errors").map((error) => {
|
|
18
15
|
if (typeof error == "string") {
|
|
19
16
|
return error;
|
|
20
17
|
}
|
|
21
|
-
return
|
|
18
|
+
return digg(error, "message");
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
return ["No error messages found"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-messages.js","sourceRoot":"/src/","sources":["error-messages.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-messages.js","sourceRoot":"/src/","sources":["error-messages.js"],"names":[],"mappings":"AAAA,YAAY;AAEZ,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAE9B;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI;IACxC,IAAI,OAAO,IAAI,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACpD,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAC7B,OAAO,KAAK,CAAA;YACd,CAAC;YAED,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QAC/B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -1,70 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1
|
+
import ModelEvents from "./model-events.js";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import propTypesExact from "prop-types-exact";
|
|
4
|
+
import React from "react";
|
|
5
|
+
export default class ApiMakerEventConnection extends React.PureComponent {
|
|
6
|
+
static defaultProps = {
|
|
7
|
+
active: true
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var react_1 = __importDefault(require("react"));
|
|
25
|
-
var ApiMakerEventConnection = /** @class */ (function (_super) {
|
|
26
|
-
__extends(ApiMakerEventConnection, _super);
|
|
27
|
-
function ApiMakerEventConnection() {
|
|
28
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
9
|
+
static propTypes = propTypesExact({
|
|
10
|
+
active: PropTypes.bool.isRequired,
|
|
11
|
+
model: PropTypes.object.isRequired,
|
|
12
|
+
event: PropTypes.string.isRequired,
|
|
13
|
+
onCall: PropTypes.func.isRequired
|
|
14
|
+
});
|
|
15
|
+
componentDidMount() {
|
|
16
|
+
this.subscription = ModelEvents.connect(this.props.model, this.props.event, (...args) => this.onCall(...args));
|
|
29
17
|
}
|
|
30
|
-
|
|
31
|
-
var _this = this;
|
|
32
|
-
this.subscription = model_events_js_1.default.connect(this.props.model, this.props.event, function () {
|
|
33
|
-
var args = [];
|
|
34
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
35
|
-
args[_i] = arguments[_i];
|
|
36
|
-
}
|
|
37
|
-
return _this.onCall.apply(_this, args);
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
ApiMakerEventConnection.prototype.componentWillUnmount = function () {
|
|
18
|
+
componentWillUnmount() {
|
|
41
19
|
if (this.subscription) {
|
|
42
20
|
this.subscription.unsubscribe();
|
|
43
21
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
46
24
|
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var _a;
|
|
50
|
-
var args = [];
|
|
51
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
52
|
-
args[_i] = arguments[_i];
|
|
53
|
-
}
|
|
25
|
+
}
|
|
26
|
+
onCall(...args) {
|
|
54
27
|
if (this.props.active) {
|
|
55
|
-
|
|
28
|
+
this.props.onCall(...args);
|
|
56
29
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
active: true
|
|
60
|
-
};
|
|
61
|
-
ApiMakerEventConnection.propTypes = (0, prop_types_exact_1.default)({
|
|
62
|
-
active: prop_types_1.default.bool.isRequired,
|
|
63
|
-
model: prop_types_1.default.object.isRequired,
|
|
64
|
-
event: prop_types_1.default.string.isRequired,
|
|
65
|
-
onCall: prop_types_1.default.func.isRequired
|
|
66
|
-
});
|
|
67
|
-
return ApiMakerEventConnection;
|
|
68
|
-
}(react_1.default.PureComponent));
|
|
69
|
-
exports.default = ApiMakerEventConnection;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
70
32
|
//# sourceMappingURL=event-connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-connection.js","sourceRoot":"/src/","sources":["event-connection.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-connection.js","sourceRoot":"/src/","sources":["event-connection.jsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK,CAAC,aAAa;IACtE,MAAM,CAAC,YAAY,GAAG;QACpB,MAAM,EAAE,IAAI;KACb,CAAA;IAED,MAAM,CAAC,SAAS,GAAG,cAAc,CAAC;QAChC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;QACjC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QAClC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QAClC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;KAClC,CAAC,CAAA;IAEF,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;IAChH,CAAC;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAA;QACjC,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAE,GAAG,IAAI;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC"}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
"use
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var use_event_emitter_js_1 = __importDefault(require("./use-event-emitter.js"));
|
|
18
|
-
var EventEmitterListener = function (_a) {
|
|
19
|
-
var event = _a.event, events = _a.events, onCalled = _a.onCalled, restProps = __rest(_a, ["event", "events", "onCalled"]);
|
|
20
|
-
var restPropsKeys = Object.keys(restProps);
|
|
1
|
+
import useEventEmitter from "./use-event-emitter.js";
|
|
2
|
+
const EventEmitterListener = ({ event, events, onCalled, ...restProps }) => {
|
|
3
|
+
const restPropsKeys = Object.keys(restProps);
|
|
21
4
|
if (restPropsKeys.length > 0) {
|
|
22
|
-
throw new Error(
|
|
5
|
+
throw new Error(`Unexpected props: ${restPropsKeys}`);
|
|
23
6
|
}
|
|
24
|
-
(
|
|
7
|
+
useEventEmitter(events, event, onCalled);
|
|
25
8
|
};
|
|
26
|
-
|
|
9
|
+
export default EventEmitterListener;
|
|
27
10
|
//# sourceMappingURL=event-emitter-listener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emitter-listener.js","sourceRoot":"/src/","sources":["event-emitter-listener.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-emitter-listener.js","sourceRoot":"/src/","sources":["event-emitter-listener.jsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,wBAAwB,CAAA;AAEpD,MAAM,oBAAoB,GAAG,CAAC,EAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAC,EAAE,EAAE;IACvE,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAE5C,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,qBAAqB,aAAa,EAAE,CAAC,CAAA;IACvD,CAAC;IAED,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1C,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -1,51 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
var model_events_js_1 = __importDefault(require("./model-events.js"));
|
|
22
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
23
|
-
var prop_types_exact_1 = __importDefault(require("prop-types-exact"));
|
|
24
|
-
var react_1 = __importDefault(require("react"));
|
|
25
|
-
var ApiMakerEventModelClass = /** @class */ (function (_super) {
|
|
26
|
-
__extends(ApiMakerEventModelClass, _super);
|
|
27
|
-
function ApiMakerEventModelClass() {
|
|
28
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
-
_this.render = function () { return null; };
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
ApiMakerEventModelClass.prototype.componentDidMount = function () {
|
|
1
|
+
import ModelEvents from "./model-events.js";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import propTypesExact from "prop-types-exact";
|
|
4
|
+
import React from "react";
|
|
5
|
+
export default class ApiMakerEventModelClass extends React.PureComponent {
|
|
6
|
+
static propTypes = propTypesExact({
|
|
7
|
+
event: PropTypes.string.isRequired,
|
|
8
|
+
modelClass: PropTypes.func.isRequired,
|
|
9
|
+
onCall: PropTypes.func.isRequired
|
|
10
|
+
});
|
|
11
|
+
componentDidMount() {
|
|
33
12
|
this.connect();
|
|
34
|
-
}
|
|
35
|
-
|
|
13
|
+
}
|
|
14
|
+
componentWillUnmount() {
|
|
36
15
|
if (this.connection) {
|
|
37
16
|
this.connection.unsubscribe();
|
|
38
17
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
this.connection =
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
modelClass: prop_types_1.default.func.isRequired,
|
|
46
|
-
onCall: prop_types_1.default.func.isRequired
|
|
47
|
-
});
|
|
48
|
-
return ApiMakerEventModelClass;
|
|
49
|
-
}(react_1.default.PureComponent));
|
|
50
|
-
exports.default = ApiMakerEventModelClass;
|
|
18
|
+
}
|
|
19
|
+
connect() {
|
|
20
|
+
this.connection = ModelEvents.connectModelClass(this.props.modelClass, this.props.event, this.props.onCall);
|
|
21
|
+
}
|
|
22
|
+
render = () => null;
|
|
23
|
+
}
|
|
51
24
|
//# sourceMappingURL=event-model-class.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-model-class.js","sourceRoot":"/src/","sources":["event-model-class.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-model-class.js","sourceRoot":"/src/","sources":["event-model-class.jsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK,CAAC,aAAa;IACtE,MAAM,CAAC,SAAS,GAAG,cAAc,CAAC;QAChC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QAClC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;QACrC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;KAClC,CAAC,CAAA;IAEF,iBAAiB;QACf,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA;QAC/B,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7G,CAAC;IAED,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA"}
|
package/build/events.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var events_1 = __importDefault(require("events"));
|
|
7
|
-
var events = new events_1.default();
|
|
1
|
+
import EventEmitter from "events";
|
|
2
|
+
const events = new EventEmitter();
|
|
8
3
|
events.setMaxListeners(1000);
|
|
9
|
-
|
|
4
|
+
export default events;
|
|
10
5
|
//# sourceMappingURL=events.js.map
|
package/build/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"/src/","sources":["events.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"/src/","sources":["events.js"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,QAAQ,CAAA;AAEjC,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAA;AAEjC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;AAE5B,eAAe,MAAM,CAAA"}
|