@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
|
@@ -1,117 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
51
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
52
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
53
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
54
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
55
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
60
|
-
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);
|
|
61
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
62
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
63
|
-
function step(op) {
|
|
64
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
65
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
66
|
-
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;
|
|
67
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
68
|
-
switch (op[0]) {
|
|
69
|
-
case 0: case 1: t = op; break;
|
|
70
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
71
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
72
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
73
|
-
default:
|
|
74
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
75
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
76
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
77
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
78
|
-
if (t[2]) _.ops.pop();
|
|
79
|
-
_.trys.pop(); continue;
|
|
80
|
-
}
|
|
81
|
-
op = body.call(thisArg, _);
|
|
82
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
83
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
87
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
88
|
-
};
|
|
89
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
90
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
91
|
-
var react_1 = __importStar(require("react"));
|
|
92
|
-
var react_native_1 = require("react-native");
|
|
93
|
-
var base_component_js_1 = __importDefault(require("../base-component.js"));
|
|
94
|
-
var config_reader_js_1 = __importDefault(require("./config-reader.js"));
|
|
95
|
-
var edit_page_1 = __importDefault(require("./edit-page"));
|
|
96
|
-
var flash_notifications_js_1 = __importDefault(require("flash-notifications/build/flash-notifications.js"));
|
|
97
|
-
var has_edit_config_js_1 = __importDefault(require("./has-edit-config.js"));
|
|
98
|
-
var index_page_1 = __importDefault(require("./index-page"));
|
|
99
|
-
var index_1 = __importDefault(require("./layout/index"));
|
|
100
|
-
var link_1 = __importDefault(require("../link"));
|
|
101
|
-
var memo_js_1 = __importDefault(require("set-state-compare/build/memo.js"));
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
|
+
import BaseComponent from "../base-component.js";
|
|
5
|
+
import ConfigReader from "./config-reader.js";
|
|
6
|
+
import EditPage from "./edit-page";
|
|
7
|
+
import FlashNotifications from "flash-notifications/build/flash-notifications.js";
|
|
8
|
+
import hasEditConfig from "./has-edit-config.js";
|
|
9
|
+
import IndexPage from "./index-page";
|
|
10
|
+
import Layout from "./layout/index";
|
|
11
|
+
import Link from "../link";
|
|
12
|
+
import memo from "set-state-compare/build/memo.js";
|
|
102
13
|
// @ts-expect-error
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
14
|
+
import * as models from "models.js";
|
|
15
|
+
import Params from "../params.js";
|
|
16
|
+
import { shapeComponent } from "set-state-compare/build/shape-component.js";
|
|
17
|
+
import ShowPage from "./show-page/index";
|
|
18
|
+
import ShowReflectionActions from "./show-reflection-actions";
|
|
19
|
+
import ShowReflectionPage from "./show-reflection-page";
|
|
20
|
+
import Text from "../utils/text";
|
|
21
|
+
import useCanCan from "../use-can-can.js";
|
|
22
|
+
import useCurrentUser from "../use-current-user.js";
|
|
23
|
+
import useQueryParams from "on-location-changed/build/use-query-params.js";
|
|
24
|
+
import useStyles from "../use-styles.js";
|
|
25
|
+
const styles = StyleSheet.create({
|
|
115
26
|
actionsView: {
|
|
116
27
|
flexDirection: "row",
|
|
117
28
|
alignItems: "center"
|
|
@@ -129,99 +40,54 @@ var styles = react_native_1.StyleSheet.create({
|
|
|
129
40
|
marginRight: 10
|
|
130
41
|
}
|
|
131
42
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
136
|
-
_this.loadModel = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
137
|
-
var _a, configReader, modelClass, modelId, modelName, abilities, abilitiesForModel, layoutSelect, query, model;
|
|
138
|
-
var _b, _c;
|
|
139
|
-
return __generator(this, function (_d) {
|
|
140
|
-
switch (_d.label) {
|
|
141
|
-
case 0:
|
|
142
|
-
_a = this.tt, configReader = _a.configReader, modelClass = _a.modelClass, modelId = _a.modelId, modelName = _a.modelName;
|
|
143
|
-
if (!(modelId && modelClass)) return [3 /*break*/, 3];
|
|
144
|
-
abilities = {};
|
|
145
|
-
abilitiesForModel = ["destroy", "edit"];
|
|
146
|
-
layoutSelect = (_c = (_b = configReader === null || configReader === void 0 ? void 0 : configReader.modelConfig) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.select;
|
|
147
|
-
abilities[modelName] = abilitiesForModel;
|
|
148
|
-
return [4 /*yield*/, modelClass
|
|
149
|
-
.ransack({ id_eq: modelId })
|
|
150
|
-
.abilities(abilities)];
|
|
151
|
-
case 1:
|
|
152
|
-
query = _d.sent();
|
|
153
|
-
if (layoutSelect)
|
|
154
|
-
query.select(layoutSelect);
|
|
155
|
-
return [4 /*yield*/, query.first()];
|
|
156
|
-
case 2:
|
|
157
|
-
model = _d.sent();
|
|
158
|
-
this.setState({ model: model });
|
|
159
|
-
return [3 /*break*/, 4];
|
|
160
|
-
case 3:
|
|
161
|
-
this.setState({ model: undefined });
|
|
162
|
-
_d.label = 4;
|
|
163
|
-
case 4: return [2 /*return*/];
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}); };
|
|
167
|
-
_this.onDestroyClicked = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
168
|
-
var error_1;
|
|
169
|
-
return __generator(this, function (_a) {
|
|
170
|
-
switch (_a.label) {
|
|
171
|
-
case 0:
|
|
172
|
-
if (!confirm("Are you sure?")) {
|
|
173
|
-
return [2 /*return*/];
|
|
174
|
-
}
|
|
175
|
-
_a.label = 1;
|
|
176
|
-
case 1:
|
|
177
|
-
_a.trys.push([1, 3, , 4]);
|
|
178
|
-
return [4 /*yield*/, this.s.model.destroy()];
|
|
179
|
-
case 2:
|
|
180
|
-
_a.sent();
|
|
181
|
-
params_js_1.default.changeParams({ mode: undefined, model_id: undefined });
|
|
182
|
-
return [3 /*break*/, 4];
|
|
183
|
-
case 3:
|
|
184
|
-
error_1 = _a.sent();
|
|
185
|
-
flash_notifications_js_1.default.errorResponse(error_1);
|
|
186
|
-
return [3 /*break*/, 4];
|
|
187
|
-
case 4: return [2 /*return*/];
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}); };
|
|
191
|
-
return _this;
|
|
192
|
-
}
|
|
193
|
-
ApiMakerSuperAdmin.prototype.setup = function () {
|
|
194
|
-
var _this = this;
|
|
195
|
-
var _a, _b, _c;
|
|
196
|
-
this.queryParams = (0, use_query_params_js_1.default)();
|
|
43
|
+
export default memo(shapeComponent(class ApiMakerSuperAdmin extends BaseComponent {
|
|
44
|
+
setup() {
|
|
45
|
+
this.queryParams = useQueryParams();
|
|
197
46
|
if (this.queryParams.model) {
|
|
198
47
|
this.modelClass = models[this.queryParams.model];
|
|
199
48
|
}
|
|
200
49
|
else {
|
|
201
50
|
this.modelClass = null;
|
|
202
51
|
}
|
|
203
|
-
this.configReader =
|
|
52
|
+
this.configReader = useMemo(() => this.modelClass && ConfigReader.forModel(this.modelClass), [this.modelClass]);
|
|
204
53
|
this.modelId = this.queryParams.model_id;
|
|
205
|
-
this.modelName =
|
|
206
|
-
this.currentUser = (
|
|
207
|
-
this.canCan = (
|
|
208
|
-
|
|
209
|
-
if (
|
|
210
|
-
abilities.push([
|
|
54
|
+
this.modelName = this.modelClass?.modelClassData()?.name;
|
|
55
|
+
this.currentUser = useCurrentUser();
|
|
56
|
+
this.canCan = useCanCan(() => {
|
|
57
|
+
const abilities = [];
|
|
58
|
+
if (this.modelClass)
|
|
59
|
+
abilities.push([this.modelClass, ["new"]]);
|
|
211
60
|
return abilities;
|
|
212
|
-
}, [
|
|
61
|
+
}, [this.currentUser?.id(), this.modelClass]);
|
|
213
62
|
this.useStates({
|
|
214
63
|
model: undefined
|
|
215
64
|
});
|
|
216
|
-
|
|
65
|
+
useMemo(() => { this.loadModel(); }, [this.modelId]);
|
|
66
|
+
}
|
|
67
|
+
loadModel = async () => {
|
|
68
|
+
const { configReader, modelClass, modelId, modelName } = this.tt;
|
|
69
|
+
if (modelId && modelClass) {
|
|
70
|
+
const abilities = {};
|
|
71
|
+
const abilitiesForModel = ["destroy", "edit"];
|
|
72
|
+
const layoutSelect = configReader?.modelConfig?.layout?.select;
|
|
73
|
+
abilities[modelName] = abilitiesForModel;
|
|
74
|
+
const query = await modelClass
|
|
75
|
+
.ransack({ id_eq: modelId })
|
|
76
|
+
.abilities(abilities);
|
|
77
|
+
if (layoutSelect)
|
|
78
|
+
query.select(layoutSelect);
|
|
79
|
+
const model = await query.first();
|
|
80
|
+
this.setState({ model });
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.setState({ model: undefined });
|
|
84
|
+
}
|
|
217
85
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
var modelConfigActions = (_a = configReader === null || configReader === void 0 ? void 0 : configReader.modelConfig) === null || _a === void 0 ? void 0 : _a.actions;
|
|
224
|
-
var pageToShow;
|
|
86
|
+
render() {
|
|
87
|
+
const { canCan, configReader, modelClass, modelId, modelName, queryParams } = this.tt;
|
|
88
|
+
const { model } = this.s;
|
|
89
|
+
const modelConfigActions = configReader?.modelConfig?.actions;
|
|
90
|
+
let pageToShow;
|
|
225
91
|
if (queryParams.model && queryParams.model_id && queryParams.model_reflection) {
|
|
226
92
|
pageToShow = "show_reflection";
|
|
227
93
|
}
|
|
@@ -240,20 +106,31 @@ exports.default = (0, memo_js_1.default)((0, shape_component_js_1.shapeComponent
|
|
|
240
106
|
else {
|
|
241
107
|
pageToShow = "welcome";
|
|
242
108
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
(
|
|
246
|
-
(
|
|
247
|
-
(
|
|
248
|
-
(
|
|
249
|
-
(
|
|
250
|
-
(
|
|
251
|
-
return ((
|
|
252
|
-
(
|
|
253
|
-
(
|
|
254
|
-
(
|
|
255
|
-
(
|
|
109
|
+
const actionsViewStyle = useStyles(styles, "actionsView");
|
|
110
|
+
const actions = useMemo(() => _jsxs(View, { style: actionsViewStyle, children: [model && modelConfigActions && modelConfigActions({ model }), modelClass && pageToShow == "index" &&
|
|
111
|
+
_jsx(_Fragment, { children: canCan?.can("new", modelClass) && hasEditConfig(modelClass) &&
|
|
112
|
+
_jsx(Link, { dataSet: { class: "create-new-model-link" }, style: styles.createNewModelLink, to: Params.withParams({ model: modelName, mode: "new" }), children: _jsx(Text, { children: "Create new" }) }) }), model && pageToShow == "show" &&
|
|
113
|
+
_jsxs(_Fragment, { children: [model.can("edit") && hasEditConfig(modelClass) &&
|
|
114
|
+
_jsx(Link, { dataSet: { class: "edit-model-link" }, style: styles.editModelLink, to: Params.withParams({ model: modelName, model_id: modelId, mode: "edit" }), children: _jsx(Text, { children: "Edit" }) }), model.can("destroy") &&
|
|
115
|
+
_jsx(Pressable, { dataSet: { class: "destroy-model-link" }, onPress: this.tt.onDestroyClicked, style: styles.destroyModelLink, children: _jsx(Text, { children: "Delete" }) })] }), pageToShow == "show_reflection" &&
|
|
116
|
+
_jsx(ShowReflectionActions, { model: model, modelClass: modelClass, reflectionName: queryParams.model_reflection })] }), [canCan, configReader?.actions, model, modelClass, pageToShow]);
|
|
117
|
+
return (_jsxs(Layout, { actions: actions, active: queryParams.model, headerTitle: modelClass?.modelName()?.human({ count: 2 }), children: [pageToShow == "index" &&
|
|
118
|
+
_jsx(IndexPage, { modelClass: modelClass }, `index-page-${modelName}`), pageToShow == "show" &&
|
|
119
|
+
_jsx(ShowPage, { modelClass: modelClass, modelId: modelId }, `show-page-${modelName}-${modelId}`), pageToShow == "show_reflection" &&
|
|
120
|
+
_jsx(ShowReflectionPage, { modelClass: modelClass, modelId: modelId }, `show-reflection-page-${modelName}-${modelId}`), pageToShow == "edit" &&
|
|
121
|
+
_jsx(EditPage, { modelClass: modelClass }, `edit-page-${modelName}-${modelId}`)] }));
|
|
122
|
+
}
|
|
123
|
+
onDestroyClicked = async () => {
|
|
124
|
+
if (!confirm("Are you sure?")) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
await this.s.model.destroy();
|
|
129
|
+
Params.changeParams({ mode: undefined, model_id: undefined });
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
FlashNotifications.errorResponse(error);
|
|
133
|
+
}
|
|
256
134
|
};
|
|
257
|
-
|
|
258
|
-
}(base_component_js_1.default))));
|
|
135
|
+
}));
|
|
259
136
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/src/","sources":["super-admin/index.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/src/","sources":["super-admin/index.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAA;AACxD,OAAO,aAAa,MAAM,sBAAsB,CAAA;AAChD,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,kBAAkB,MAAM,kDAAkD,CAAA;AACjF,OAAO,aAAa,MAAM,sBAAsB,CAAA;AAChD,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAA;AACnC,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,IAAI,MAAM,iCAAiC,CAAA;AAClD,mBAAmB;AACnB,OAAO,KAAK,MAAM,MAAM,WAAW,CAAA;AACnC,OAAO,MAAM,MAAM,cAAc,CAAA;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,4CAA4C,CAAA;AACzE,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,qBAAqB,MAAM,2BAA2B,CAAA;AAC7D,OAAO,kBAAkB,MAAM,wBAAwB,CAAA;AACvD,OAAO,IAAI,MAAM,eA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AA;CACF,CAAC,CAAC,CAAA"}
|
|
@@ -1,157 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
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 __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
|
-
};
|
|
53
|
-
var _a;
|
|
54
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
56
2
|
// import "../../../../src/super-admin/layout/header/style"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
3
|
+
import React, { useRef } from "react";
|
|
4
|
+
import BaseComponent from "../../../base-component.js";
|
|
5
|
+
import Icon from "../../../utils/icon";
|
|
6
|
+
import memo from "set-state-compare/build/memo.js";
|
|
7
|
+
import PropTypes from "prop-types";
|
|
8
|
+
import PropTypesExact from "prop-types-exact";
|
|
9
|
+
import { shapeComponent } from "set-state-compare/build/shape-component.js";
|
|
10
|
+
import Text from "../../../utils/text";
|
|
11
|
+
import { Pressable, View } from "react-native";
|
|
12
|
+
import useBreakpoint from "../../../use-breakpoint.js";
|
|
13
|
+
import useEventListener from "../../../use-event-listener.js";
|
|
14
|
+
export default memo(shapeComponent(class ApiMakerSuperAdminLayoutHeader extends BaseComponent {
|
|
15
|
+
static propTypes = PropTypesExact({
|
|
16
|
+
actions: PropTypes.any,
|
|
17
|
+
onTriggerMenu: PropTypes.func.isRequired,
|
|
18
|
+
title: PropTypes.string
|
|
19
|
+
});
|
|
20
|
+
setup() {
|
|
21
|
+
const { name: breakpoint, mdUp } = useBreakpoint();
|
|
22
|
+
this.headerActionsRef = useRef();
|
|
23
|
+
this.setInstance({ breakpoint, mdUp });
|
|
24
|
+
this.useStates({
|
|
25
|
+
headerActionsActive: false
|
|
26
|
+
});
|
|
27
|
+
useEventListener(window, "mouseup", this.tt.onWindowMouseUp);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const { breakpoint, mdUp } = this.tt;
|
|
31
|
+
const { actions, onTriggerMenu, title } = this.props;
|
|
32
|
+
const headerStyle = {
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "row",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
zIndex: 9,
|
|
37
|
+
height: 100,
|
|
38
|
+
paddingRight: 30,
|
|
39
|
+
paddingLeft: 30,
|
|
40
|
+
backgroundColor: "#fff"
|
|
89
41
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
42
|
+
const headerActionsContainerStyle = {};
|
|
43
|
+
const headerActionsStyle = {};
|
|
44
|
+
if (breakpoint == "xs" || breakpoint == "sm") {
|
|
45
|
+
headerStyle.position = "absolute";
|
|
46
|
+
headerStyle.width = "100%";
|
|
47
|
+
Object.assign(headerActionsContainerStyle, {
|
|
48
|
+
position: "fixed",
|
|
49
|
+
top: 0,
|
|
50
|
+
left: 0,
|
|
94
51
|
display: "flex",
|
|
95
|
-
|
|
52
|
+
width: "100vw",
|
|
53
|
+
height: "100vh",
|
|
96
54
|
alignItems: "center",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
var headerActionsContainerStyle = {};
|
|
104
|
-
var headerActionsStyle = {};
|
|
105
|
-
if (breakpoint == "xs" || breakpoint == "sm") {
|
|
106
|
-
headerStyle.position = "absolute";
|
|
107
|
-
headerStyle.width = "100%";
|
|
108
|
-
Object.assign(headerActionsContainerStyle, {
|
|
109
|
-
position: "fixed",
|
|
110
|
-
top: 0,
|
|
111
|
-
left: 0,
|
|
112
|
-
display: "flex",
|
|
113
|
-
width: "100vw",
|
|
114
|
-
height: "100vh",
|
|
115
|
-
alignItems: "center",
|
|
116
|
-
justifyContent: "center",
|
|
117
|
-
background: "rgba(#000, .8)"
|
|
118
|
-
});
|
|
119
|
-
if (!this.s.headerActionsActive) {
|
|
120
|
-
headerActionsContainerStyle.display = "none";
|
|
121
|
-
}
|
|
122
|
-
Object.assign(headerActionsStyle, {
|
|
123
|
-
minWidth: "80vw",
|
|
124
|
-
maxWidth: "100vw",
|
|
125
|
-
backgroundColor: "#fff"
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
else if (breakpoint == "md") {
|
|
129
|
-
headerStyle.position = "fixed";
|
|
130
|
-
headerStyle.left = 250;
|
|
131
|
-
headerStyle.width = "calc(100% - 250px)";
|
|
132
|
-
}
|
|
133
|
-
else if (breakpoint == "lg" || breakpoint == "xl" || breakpoint == "xxl") {
|
|
134
|
-
headerStyle.position = "fixed";
|
|
135
|
-
headerStyle.left = 290;
|
|
136
|
-
headerStyle.width = "calc(100% - 290px)";
|
|
137
|
-
}
|
|
138
|
-
if (breakpoint == "md" || breakpoint == "lg" || breakpoint == "xl" || breakpoint == "xxl") {
|
|
139
|
-
headerActionsContainerStyle.marginLeft = "auto";
|
|
55
|
+
justifyContent: "center",
|
|
56
|
+
background: "rgba(#000, .8)"
|
|
57
|
+
});
|
|
58
|
+
if (!this.s.headerActionsActive) {
|
|
59
|
+
headerActionsContainerStyle.display = "none";
|
|
140
60
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
61
|
+
Object.assign(headerActionsStyle, {
|
|
62
|
+
minWidth: "80vw",
|
|
63
|
+
maxWidth: "100vw",
|
|
64
|
+
backgroundColor: "#fff"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else if (breakpoint == "md") {
|
|
68
|
+
headerStyle.position = "fixed";
|
|
69
|
+
headerStyle.left = 250;
|
|
70
|
+
headerStyle.width = "calc(100% - 250px)";
|
|
71
|
+
}
|
|
72
|
+
else if (breakpoint == "lg" || breakpoint == "xl" || breakpoint == "xxl") {
|
|
73
|
+
headerStyle.position = "fixed";
|
|
74
|
+
headerStyle.left = 290;
|
|
75
|
+
headerStyle.width = "calc(100% - 290px)";
|
|
76
|
+
}
|
|
77
|
+
if (breakpoint == "md" || breakpoint == "lg" || breakpoint == "xl" || breakpoint == "xxl") {
|
|
78
|
+
headerActionsContainerStyle.marginLeft = "auto";
|
|
79
|
+
}
|
|
80
|
+
return (_jsxs(View, { dataSet: this.rootViewDataSet ||= { component: "super-admin--layout--header" }, style: headerStyle, children: [_jsx(View, { dataSet: this.headerTitleViewDataSet ||= { class: "header-title-container" }, children: _jsx(Text, { style: this.headerTitleTextStyle ||= { color: "#282a33", fontSize: 22 }, children: title }) }), actions &&
|
|
81
|
+
_jsx(View, { dataSet: { active: this.s.headerActionsActive, class: "header-actions-container" }, style: headerActionsContainerStyle, children: _jsx(View, { dataSet: this.headerActionsViewDataSet ||= { class: "header-actions" }, ref: this.tt.headerActionsRef, style: headerActionsStyle, children: actions }) }), !mdUp &&
|
|
82
|
+
_jsxs(View, { dataSet: this.burgerMenuContainerDataSet ||= { class: "burger-menu-container" }, style: this.burgerMenuContainerStyle ||= {
|
|
83
|
+
flexDirection: "row",
|
|
84
|
+
marginLeft: "auto"
|
|
85
|
+
}, children: [actions &&
|
|
86
|
+
_jsx(Pressable, { dataSet: this.actionsLinkDataSet ||= { class: "actions-link" }, onPress: this.tt.onGearsClicked, style: this.actionsLinkStyle ||= { marginRight: 8, fontSize: 22 }, children: _jsx(Icon, { name: "gear", size: 20 }) }), _jsx(Pressable, { dataSet: this.burgerMenuLinkDataSet ||= { class: "burger-menu-link" }, onPress: onTriggerMenu, children: _jsx(Icon, { name: "bars", size: 20 }) })] })] }));
|
|
87
|
+
}
|
|
88
|
+
onGearsClicked = () => this.setState({ headerActionsActive: !this.s.headerActionsActive });
|
|
89
|
+
onWindowMouseUp = (e) => {
|
|
90
|
+
// Close the header actions menu if clicked happened outside
|
|
91
|
+
if (this.s.headerActionsActive && this.tt.headerActionsRef.current && !this.tt.headerActionsRef.current.contains(e.target)) {
|
|
92
|
+
this.setState({ headerActionsActive: false });
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}));
|
|
157
96
|
//# sourceMappingURL=index.js.map
|