@kaspernj/api-maker 1.0.2053 → 1.0.2054
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.d.ts +19 -0
- package/build/api.d.ts.map +1 -0
- package/build/api.js +232 -116
- package/build/api.js.map +1 -0
- package/build/attribute-not-loaded-error.d.ts +3 -0
- package/build/attribute-not-loaded-error.d.ts.map +1 -0
- package/build/attribute-not-loaded-error.js +26 -2
- package/build/attribute-not-loaded-error.js.map +1 -0
- package/build/base-component.d.ts +4 -0
- package/build/base-component.d.ts.map +1 -0
- package/build/base-component.js +27 -5
- package/build/base-component.js.map +1 -0
- package/build/base-error.d.ts +31 -0
- package/build/base-error.d.ts.map +1 -0
- package/build/base-error.js +74 -31
- package/build/base-error.js.map +1 -0
- package/build/base-model/attribute.d.ts +45 -0
- package/build/base-model/attribute.d.ts.map +1 -0
- package/build/base-model/attribute.js +58 -24
- package/build/base-model/attribute.js.map +1 -0
- package/build/base-model/column.d.ts +17 -0
- package/build/base-model/column.d.ts.map +1 -0
- package/build/base-model/column.js +21 -10
- package/build/base-model/column.js.map +1 -0
- package/build/base-model/reflection.d.ts +22 -0
- package/build/base-model/reflection.d.ts.map +1 -0
- package/build/base-model/reflection.js +66 -14
- package/build/base-model/reflection.js.map +1 -0
- package/build/base-model/scope.d.ts +9 -0
- package/build/base-model/scope.d.ts.map +1 -0
- package/build/base-model/scope.js +51 -11
- package/build/base-model/scope.js.map +1 -0
- package/build/base-model.js +1282 -821
- package/build/base-model.js.map +1 -0
- package/build/bootstrap/attribute-row.d.ts +3 -0
- package/build/bootstrap/attribute-row.d.ts.map +1 -0
- package/build/bootstrap/attribute-row.js +178 -132
- package/build/bootstrap/attribute-row.js.map +1 -0
- package/build/bootstrap/attribute-rows.d.ts +3 -0
- package/build/bootstrap/attribute-rows.d.ts.map +1 -0
- package/build/bootstrap/attribute-rows.js +52 -31
- package/build/bootstrap/attribute-rows.js.map +1 -0
- package/build/bootstrap/card.d.ts +3 -0
- package/build/bootstrap/card.d.ts.map +1 -0
- package/build/bootstrap/card.js +163 -135
- package/build/bootstrap/card.js.map +1 -0
- package/build/bootstrap/checkbox.d.ts +3 -0
- package/build/bootstrap/checkbox.d.ts.map +1 -0
- package/build/bootstrap/checkbox.js +105 -97
- package/build/bootstrap/checkbox.js.map +1 -0
- package/build/bootstrap/checkboxes.d.ts +3 -0
- package/build/bootstrap/checkboxes.d.ts.map +1 -0
- package/build/bootstrap/checkboxes.js +206 -180
- package/build/bootstrap/checkboxes.js.map +1 -0
- package/build/bootstrap/index.d.ts +1 -0
- package/build/bootstrap/index.d.ts.map +1 -0
- package/build/bootstrap/index.js +1 -2
- package/build/bootstrap/index.js.map +1 -0
- package/build/bootstrap/input.d.ts +3 -0
- package/build/bootstrap/input.d.ts.map +1 -0
- package/build/bootstrap/input.js +135 -129
- package/build/bootstrap/input.js.map +1 -0
- package/build/bootstrap/invalid-feedback.d.ts +6 -0
- package/build/bootstrap/invalid-feedback.d.ts.map +1 -0
- package/build/bootstrap/invalid-feedback.js +51 -26
- package/build/bootstrap/invalid-feedback.js.map +1 -0
- package/build/bootstrap/paginate.d.ts +3 -0
- package/build/bootstrap/paginate.d.ts.map +1 -0
- package/build/bootstrap/paginate.js +165 -148
- package/build/bootstrap/paginate.js.map +1 -0
- package/build/bootstrap/radio-buttons.d.ts +3 -0
- package/build/bootstrap/radio-buttons.d.ts.map +1 -0
- package/build/bootstrap/radio-buttons.js +89 -72
- package/build/bootstrap/radio-buttons.js.map +1 -0
- package/build/bootstrap/select.d.ts +3 -0
- package/build/bootstrap/select.d.ts.map +1 -0
- package/build/bootstrap/select.js +103 -88
- package/build/bootstrap/select.js.map +1 -0
- package/build/bootstrap/sort-link.d.ts +3 -0
- package/build/bootstrap/sort-link.d.ts.map +1 -0
- package/build/bootstrap/sort-link.js +153 -129
- package/build/bootstrap/sort-link.js.map +1 -0
- package/build/cable-connection-pool.d.ts +27 -0
- package/build/cable-connection-pool.d.ts.map +1 -0
- package/build/cable-connection-pool.js +118 -123
- package/build/cable-connection-pool.js.map +1 -0
- package/build/cable-subscription-pool.d.ts +16 -0
- package/build/cable-subscription-pool.d.ts.map +1 -0
- package/build/cable-subscription-pool.js +211 -199
- package/build/cable-subscription-pool.js.map +1 -0
- package/build/cable-subscription.d.ts +7 -0
- package/build/cable-subscription.d.ts.map +1 -0
- package/build/cable-subscription.js +25 -20
- package/build/cable-subscription.js.map +1 -0
- package/build/cache-key-generator.d.ts +15 -0
- package/build/cache-key-generator.d.ts.map +1 -0
- package/build/cache-key-generator.js +86 -78
- package/build/cache-key-generator.js.map +1 -0
- package/build/can-can.d.ts +19 -0
- package/build/can-can.d.ts.map +1 -0
- package/build/can-can.js +243 -128
- package/build/can-can.js.map +1 -0
- package/build/channels-consumer.d.ts +3 -0
- package/build/channels-consumer.d.ts.map +1 -0
- package/build/channels-consumer.js +13 -8
- package/build/channels-consumer.js.map +1 -0
- package/build/collection-loader.d.ts +3 -0
- package/build/collection-loader.d.ts.map +1 -0
- package/build/collection-loader.js +70 -46
- package/build/collection-loader.js.map +1 -0
- package/build/collection.d.ts +213 -0
- package/build/collection.d.ts.map +1 -0
- package/build/collection.js +592 -306
- package/build/collection.js.map +1 -0
- package/build/command-submit-data.d.ts +54 -0
- package/build/command-submit-data.d.ts.map +1 -0
- package/build/command-submit-data.js +126 -80
- package/build/command-submit-data.js.map +1 -0
- package/build/commands-pool.d.ts +63 -0
- package/build/commands-pool.d.ts.map +1 -0
- package/build/commands-pool.js +281 -189
- package/build/commands-pool.js.map +1 -0
- package/build/compose.d.ts +2 -0
- package/build/compose.d.ts.map +1 -0
- package/build/compose.js +17 -8
- package/build/compose.js.map +1 -0
- package/build/config.d.ts +9 -0
- package/build/config.d.ts.map +1 -0
- package/build/config.js +105 -70
- package/build/config.js.map +1 -0
- package/build/custom-error.d.ts +8 -0
- package/build/custom-error.d.ts.map +1 -0
- package/build/custom-error.js +30 -4
- package/build/custom-error.js.map +1 -0
- package/build/data-set-to-attributes.d.ts +2 -0
- package/build/data-set-to-attributes.d.ts.map +1 -0
- package/build/data-set-to-attributes.js +45 -9
- package/build/data-set-to-attributes.js.map +1 -0
- package/build/deserializer.d.ts +4 -0
- package/build/deserializer.d.ts.map +1 -0
- package/build/deserializer.js +109 -54
- package/build/deserializer.js.map +1 -0
- package/build/destroy-error.d.ts +8 -0
- package/build/destroy-error.d.ts.map +1 -0
- package/build/destroy-error.js +30 -4
- package/build/destroy-error.js.map +1 -0
- package/build/devise.d.ts +20 -0
- package/build/devise.d.ts.map +1 -0
- package/build/devise.js +214 -123
- package/build/devise.js.map +1 -0
- package/build/draggable-sort/controller.d.ts +41 -0
- package/build/draggable-sort/controller.d.ts.map +1 -0
- package/build/draggable-sort/controller.js +130 -133
- package/build/draggable-sort/controller.js.map +1 -0
- package/build/draggable-sort/index.d.ts +3 -0
- package/build/draggable-sort/index.d.ts.map +1 -0
- package/build/draggable-sort/index.js +147 -111
- package/build/draggable-sort/index.js.map +1 -0
- package/build/draggable-sort/item.d.ts +3 -0
- package/build/draggable-sort/item.d.ts.map +1 -0
- package/build/draggable-sort/item.js +199 -183
- package/build/draggable-sort/item.js.map +1 -0
- package/build/error-logger.d.ts +20 -0
- package/build/error-logger.d.ts.map +1 -0
- package/build/error-logger.js +184 -92
- package/build/error-logger.js.map +1 -0
- package/build/error-messages.d.ts +18 -0
- package/build/error-messages.d.ts.map +1 -0
- package/build/error-messages.js +26 -13
- package/build/error-messages.js.map +1 -0
- package/build/event-connection.d.ts +12 -0
- package/build/event-connection.d.ts.map +1 -0
- package/build/event-connection.js +69 -31
- package/build/event-connection.js.map +1 -0
- package/build/event-emitter-listener.d.ts +8 -0
- package/build/event-emitter-listener.d.ts.map +1 -0
- package/build/event-emitter-listener.js +26 -14
- package/build/event-emitter-listener.js.map +1 -0
- package/build/event-model-class.d.ts +9 -0
- package/build/event-model-class.d.ts.map +1 -0
- package/build/event-model-class.js +50 -23
- package/build/event-model-class.js.map +1 -0
- package/build/events.d.ts +4 -0
- package/build/events.d.ts.map +1 -0
- package/build/events.js +9 -4
- package/build/events.js.map +1 -0
- package/build/form.d.ts +14 -0
- package/build/form.d.ts.map +1 -0
- package/build/form.js +169 -97
- package/build/form.js.map +1 -0
- package/build/history-expo.d.ts +6 -0
- package/build/history-expo.d.ts.map +1 -0
- package/build/history-expo.js +28 -19
- package/build/history-expo.js.map +1 -0
- package/build/history-react-native.d.ts +6 -0
- package/build/history-react-native.d.ts.map +1 -0
- package/build/history-react-native.js +29 -19
- package/build/history-react-native.js.map +1 -0
- package/build/history.d.ts +3 -0
- package/build/history.d.ts.map +1 -0
- package/build/history.js +5 -3
- package/build/history.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +6 -3
- package/build/index.js.map +1 -0
- package/build/inputs/attachment.d.ts +3 -0
- package/build/inputs/attachment.d.ts.map +1 -0
- package/build/inputs/attachment.js +125 -133
- package/build/inputs/attachment.js.map +1 -0
- package/build/inputs/auto-submit.d.ts +9 -0
- package/build/inputs/auto-submit.d.ts.map +1 -0
- package/build/inputs/auto-submit.js +71 -35
- package/build/inputs/auto-submit.js.map +1 -0
- package/build/inputs/checkbox.d.ts +3 -0
- package/build/inputs/checkbox.d.ts.map +1 -0
- package/build/inputs/checkbox.js +171 -136
- package/build/inputs/checkbox.js.map +1 -0
- package/build/inputs/checkboxes.d.ts +3 -0
- package/build/inputs/checkboxes.d.ts.map +1 -0
- package/build/inputs/checkboxes.js +161 -110
- package/build/inputs/checkboxes.js.map +1 -0
- package/build/inputs/id-for-component.d.ts +2 -0
- package/build/inputs/id-for-component.d.ts.map +1 -0
- package/build/inputs/id-for-component.js +53 -14
- package/build/inputs/id-for-component.js.map +1 -0
- package/build/inputs/input-wrapper.d.ts +3 -0
- package/build/inputs/input-wrapper.d.ts.map +1 -0
- package/build/inputs/input-wrapper.js +27 -18
- package/build/inputs/input-wrapper.js.map +1 -0
- package/build/inputs/input.d.ts +5 -0
- package/build/inputs/input.d.ts.map +1 -0
- package/build/inputs/input.js +250 -240
- package/build/inputs/input.js.map +1 -0
- package/build/inputs/money.d.ts +3 -0
- package/build/inputs/money.d.ts.map +1 -0
- package/build/inputs/money.js +189 -171
- package/build/inputs/money.js.map +1 -0
- package/build/inputs/name-for-component.d.ts +2 -0
- package/build/inputs/name-for-component.d.ts.map +1 -0
- package/build/inputs/name-for-component.js +48 -11
- package/build/inputs/name-for-component.js.map +1 -0
- package/build/inputs/select.d.ts +5 -0
- package/build/inputs/select.d.ts.map +1 -0
- package/build/inputs/select.js +128 -93
- package/build/inputs/select.js.map +1 -0
- package/build/instance-of-class-name.d.ts +3 -0
- package/build/instance-of-class-name.d.ts.map +1 -0
- package/build/instance-of-class-name.js +24 -21
- package/build/instance-of-class-name.js.map +1 -0
- package/build/is-expo.d.ts +3 -0
- package/build/is-expo.d.ts.map +1 -0
- package/build/is-expo.js +16 -20
- package/build/is-expo.js.map +1 -0
- package/build/key-value-store.d.ts +11 -0
- package/build/key-value-store.d.ts.map +1 -0
- package/build/key-value-store.js +133 -51
- package/build/key-value-store.js.map +1 -0
- package/build/link.d.ts +3 -0
- package/build/link.d.ts.map +1 -0
- package/build/link.js +120 -82
- package/build/link.js.map +1 -0
- package/build/logger.d.ts +13 -0
- package/build/logger.d.ts.map +1 -0
- package/build/logger.js +39 -29
- package/build/logger.js.map +1 -0
- package/build/merge-styles.d.ts +2 -0
- package/build/merge-styles.d.ts.map +1 -0
- package/build/merge-styles.js +16 -11
- package/build/merge-styles.js.map +1 -0
- package/build/modal.d.ts +3 -0
- package/build/modal.d.ts.map +1 -0
- package/build/modal.js +71 -38
- package/build/modal.js.map +1 -0
- package/build/model-class-require.d.ts +3 -0
- package/build/model-class-require.d.ts.map +1 -0
- package/build/model-class-require.js +47 -12
- package/build/model-class-require.js.map +1 -0
- package/build/model-events.d.ts +8 -0
- package/build/model-events.d.ts.map +1 -0
- package/build/model-events.js +39 -30
- package/build/model-events.js.map +1 -0
- package/build/model-name.d.ts +8 -0
- package/build/model-name.d.ts.map +1 -0
- package/build/model-name.js +66 -26
- package/build/model-name.js.map +1 -0
- package/build/model-prop-type.d.ts +21 -0
- package/build/model-prop-type.d.ts.map +1 -0
- package/build/model-prop-type.js +107 -98
- package/build/model-prop-type.js.map +1 -0
- package/build/model-recipes-loader.d.ts +10 -0
- package/build/model-recipes-loader.d.ts.map +1 -0
- package/build/model-recipes-loader.js +30 -31
- package/build/model-recipes-loader.js.map +1 -0
- package/build/model-recipes-model-loader.d.ts +202 -0
- package/build/model-recipes-model-loader.d.ts.map +1 -0
- package/build/model-recipes-model-loader.js +304 -344
- package/build/model-recipes-model-loader.js.map +1 -0
- package/build/models-response-reader.d.ts +9 -0
- package/build/models-response-reader.d.ts.map +1 -0
- package/build/models-response-reader.js +79 -39
- package/build/models-response-reader.js.map +1 -0
- package/build/models.d.ts +3 -0
- package/build/models.d.ts.map +1 -0
- package/build/models.js +11 -8
- package/build/models.js.map +1 -0
- package/build/money-formatter.d.ts +17 -0
- package/build/money-formatter.d.ts.map +1 -0
- package/build/money-formatter.js +93 -76
- package/build/money-formatter.js.map +1 -0
- package/build/not-loaded-error.d.ts +3 -0
- package/build/not-loaded-error.d.ts.map +1 -0
- package/build/not-loaded-error.js +26 -2
- package/build/not-loaded-error.js.map +1 -0
- package/build/params.d.ts +16 -0
- package/build/params.d.ts.map +1 -0
- package/build/params.js +73 -60
- package/build/params.js.map +1 -0
- package/build/preloaded.d.ts +8 -0
- package/build/preloaded.d.ts.map +1 -0
- package/build/preloaded.js +73 -36
- package/build/preloaded.js.map +1 -0
- package/build/resize-observer.d.ts +3 -0
- package/build/resize-observer.d.ts.map +1 -0
- package/build/resize-observer.js +13 -10
- package/build/resize-observer.js.map +1 -0
- package/build/rest-props-validator.d.ts +3 -0
- package/build/rest-props-validator.d.ts.map +1 -0
- package/build/rest-props-validator.js +9 -7
- package/build/rest-props-validator.js.map +1 -0
- package/build/result.d.ts +38 -0
- package/build/result.d.ts.map +1 -0
- package/build/result.js +43 -13
- package/build/result.js.map +1 -0
- package/build/router/route.d.ts +8 -0
- package/build/router/route.d.ts.map +1 -0
- package/build/router/route.js +322 -266
- package/build/router/route.js.map +1 -0
- package/build/router/switch.d.ts +4 -0
- package/build/router/switch.d.ts.map +1 -0
- package/build/router/switch.js +132 -70
- package/build/router/switch.js.map +1 -0
- package/build/router.d.ts +3 -0
- package/build/router.d.ts.map +1 -0
- package/build/router.js +94 -57
- package/build/router.js.map +1 -0
- package/build/routes-native.d.ts +24 -0
- package/build/routes-native.d.ts.map +1 -0
- package/build/routes-native.js +233 -198
- package/build/routes-native.js.map +1 -0
- package/build/routes.d.ts +10 -0
- package/build/routes.d.ts.map +1 -0
- package/build/routes.js +102 -48
- package/build/routes.js.map +1 -0
- package/build/run-last.d.ts +12 -0
- package/build/run-last.d.ts.map +1 -0
- package/build/run-last.js +40 -34
- package/build/run-last.js.map +1 -0
- package/build/serializer.d.ts +10 -0
- package/build/serializer.d.ts.map +1 -0
- package/build/serializer.js +73 -62
- package/build/serializer.js.map +1 -0
- package/build/services.d.ts +5 -0
- package/build/services.d.ts.map +1 -0
- package/build/services.js +30 -20
- package/build/services.js.map +1 -0
- package/build/session-status-updater.d.ts +21 -0
- package/build/session-status-updater.d.ts.map +1 -0
- package/build/session-status-updater.js +227 -130
- package/build/session-status-updater.js.map +1 -0
- package/build/source-maps-loader.js +279 -176
- package/build/source-maps-loader.js.map +1 -0
- package/build/super-admin/config-reader.d.ts +23 -0
- package/build/super-admin/config-reader.d.ts.map +1 -0
- package/build/super-admin/config-reader.js +116 -82
- package/build/super-admin/config-reader.js.map +1 -0
- package/build/super-admin/edit-page/edit-attribute-checkbox.d.ts +3 -0
- package/build/super-admin/edit-page/edit-attribute-checkbox.d.ts.map +1 -0
- package/build/super-admin/edit-page/edit-attribute-checkbox.js +118 -83
- package/build/super-admin/edit-page/edit-attribute-checkbox.js.map +1 -0
- package/build/super-admin/edit-page/edit-attribute-content.d.ts +3 -0
- package/build/super-admin/edit-page/edit-attribute-content.d.ts.map +1 -0
- package/build/super-admin/edit-page/edit-attribute-content.js +79 -55
- package/build/super-admin/edit-page/edit-attribute-content.js.map +1 -0
- package/build/super-admin/edit-page/edit-attribute-input.d.ts +3 -0
- package/build/super-admin/edit-page/edit-attribute-input.d.ts.map +1 -0
- package/build/super-admin/edit-page/edit-attribute-input.js +119 -77
- package/build/super-admin/edit-page/edit-attribute-input.js.map +1 -0
- package/build/super-admin/edit-page/edit-attribute.d.ts +3 -0
- package/build/super-admin/edit-page/edit-attribute.d.ts.map +1 -0
- package/build/super-admin/edit-page/edit-attribute.js +105 -76
- package/build/super-admin/edit-page/edit-attribute.js.map +1 -0
- package/build/super-admin/edit-page.d.ts +3 -0
- package/build/super-admin/edit-page.d.ts.map +1 -0
- package/build/super-admin/edit-page.js +202 -120
- package/build/super-admin/edit-page.js.map +1 -0
- package/build/super-admin/has-edit-config.d.ts +3 -0
- package/build/super-admin/has-edit-config.d.ts.map +1 -0
- package/build/super-admin/has-edit-config.js +17 -11
- package/build/super-admin/has-edit-config.js.map +1 -0
- package/build/super-admin/index-page.d.ts +3 -0
- package/build/super-admin/index-page.d.ts.map +1 -0
- package/build/super-admin/index-page.js +45 -25
- package/build/super-admin/index-page.js.map +1 -0
- package/build/super-admin/index.d.ts +3 -0
- package/build/super-admin/index.d.ts.map +1 -0
- package/build/super-admin/index.js +254 -184
- package/build/super-admin/index.js.map +1 -0
- package/build/super-admin/layout/header/index.d.ts +3 -0
- package/build/super-admin/layout/header/index.d.ts.map +1 -0
- package/build/super-admin/layout/header/index.js +154 -155
- package/build/super-admin/layout/header/index.js.map +1 -0
- package/build/super-admin/layout/index.d.ts +3 -0
- package/build/super-admin/layout/index.d.ts.map +1 -0
- package/build/super-admin/layout/index.js +183 -160
- package/build/super-admin/layout/index.js.map +1 -0
- package/build/super-admin/layout/menu/index.d.ts +3 -0
- package/build/super-admin/layout/menu/index.d.ts.map +1 -0
- package/build/super-admin/layout/menu/index.js +191 -203
- package/build/super-admin/layout/menu/index.js.map +1 -0
- package/build/super-admin/layout/menu/menu-content.d.ts +3 -0
- package/build/super-admin/layout/menu/menu-content.d.ts.map +1 -0
- package/build/super-admin/layout/menu/menu-content.js +86 -45
- package/build/super-admin/layout/menu/menu-content.js.map +1 -0
- package/build/super-admin/layout/menu/menu-item.d.ts +3 -0
- package/build/super-admin/layout/menu/menu-item.d.ts.map +1 -0
- package/build/super-admin/layout/menu/menu-item.js +104 -83
- package/build/super-admin/layout/menu/menu-item.js.map +1 -0
- package/build/super-admin/layout/no-access.d.ts +3 -0
- package/build/super-admin/layout/no-access.d.ts.map +1 -0
- package/build/super-admin/layout/no-access.js +46 -27
- package/build/super-admin/layout/no-access.js.map +1 -0
- package/build/super-admin/model-class-table.d.ts +3 -0
- package/build/super-admin/model-class-table.d.ts.map +1 -0
- package/build/super-admin/model-class-table.js +132 -60
- package/build/super-admin/model-class-table.js.map +1 -0
- package/build/super-admin/models.d.ts +3 -0
- package/build/super-admin/models.d.ts.map +1 -0
- package/build/super-admin/models.js +43 -7
- package/build/super-admin/models.js.map +1 -0
- package/build/super-admin/show-nav.d.ts +3 -0
- package/build/super-admin/show-nav.d.ts.map +1 -0
- package/build/super-admin/show-nav.js +90 -51
- package/build/super-admin/show-nav.js.map +1 -0
- package/build/super-admin/show-page/belongs-to-attribute-row.d.ts +3 -0
- package/build/super-admin/show-page/belongs-to-attribute-row.d.ts.map +1 -0
- package/build/super-admin/show-page/belongs-to-attribute-row.js +77 -28
- package/build/super-admin/show-page/belongs-to-attribute-row.js.map +1 -0
- package/build/super-admin/show-page/index.d.ts +3 -0
- package/build/super-admin/show-page/index.d.ts.map +1 -0
- package/build/super-admin/show-page/index.js +202 -137
- package/build/super-admin/show-page/index.js.map +1 -0
- package/build/super-admin/show-reflection-actions.d.ts +3 -0
- package/build/super-admin/show-reflection-actions.d.ts.map +1 -0
- package/build/super-admin/show-reflection-actions.js +100 -50
- package/build/super-admin/show-reflection-actions.js.map +1 -0
- package/build/super-admin/show-reflection-link.d.ts +3 -0
- package/build/super-admin/show-reflection-link.d.ts.map +1 -0
- package/build/super-admin/show-reflection-link.js +101 -47
- package/build/super-admin/show-reflection-link.js.map +1 -0
- package/build/super-admin/show-reflection-page.d.ts +3 -0
- package/build/super-admin/show-reflection-page.d.ts.map +1 -0
- package/build/super-admin/show-reflection-page.js +98 -49
- package/build/super-admin/show-reflection-page.js.map +1 -0
- package/build/table/column-content.d.ts +25 -0
- package/build/table/column-content.d.ts.map +1 -0
- package/build/table/column-content.js +153 -115
- package/build/table/column-content.js.map +1 -0
- package/build/table/column-identifier.d.ts +2 -0
- package/build/table/column-identifier.d.ts.map +1 -0
- package/build/table/column-identifier.js +22 -16
- package/build/table/column-identifier.js.map +1 -0
- package/build/table/column-visible.d.ts +2 -0
- package/build/table/column-visible.d.ts.map +1 -0
- package/build/table/column-visible.js +12 -6
- package/build/table/column-visible.js.map +1 -0
- package/build/table/components/column.d.ts +3 -0
- package/build/table/components/column.d.ts.map +1 -0
- package/build/table/components/column.js +61 -21
- package/build/table/components/column.js.map +1 -0
- package/build/table/components/flat-list.d.ts +3 -0
- package/build/table/components/flat-list.d.ts.map +1 -0
- package/build/table/components/flat-list.js +61 -21
- package/build/table/components/flat-list.js.map +1 -0
- package/build/table/components/header.d.ts +3 -0
- package/build/table/components/header.d.ts.map +1 -0
- package/build/table/components/header.js +63 -26
- package/build/table/components/header.js.map +1 -0
- package/build/table/components/row.d.ts +3 -0
- package/build/table/components/row.d.ts.map +1 -0
- package/build/table/components/row.js +65 -26
- package/build/table/components/row.js.map +1 -0
- package/build/table/filters/attribute-element.d.ts +3 -0
- package/build/table/filters/attribute-element.d.ts.map +1 -0
- package/build/table/filters/attribute-element.js +63 -44
- package/build/table/filters/attribute-element.js.map +1 -0
- package/build/table/filters/filter-form.d.ts +3 -0
- package/build/table/filters/filter-form.d.ts.map +1 -0
- package/build/table/filters/filter-form.js +489 -453
- package/build/table/filters/filter-form.js.map +1 -0
- package/build/table/filters/filter.d.ts +3 -0
- package/build/table/filters/filter.d.ts.map +1 -0
- package/build/table/filters/filter.js +75 -90
- package/build/table/filters/filter.js.map +1 -0
- package/build/table/filters/index.d.ts +3 -0
- package/build/table/filters/index.d.ts.map +1 -0
- package/build/table/filters/index.js +143 -188
- package/build/table/filters/index.js.map +1 -0
- package/build/table/filters/load-search-modal.d.ts +3 -0
- package/build/table/filters/load-search-modal.d.ts.map +1 -0
- package/build/table/filters/load-search-modal.js +234 -169
- package/build/table/filters/load-search-modal.js.map +1 -0
- package/build/table/filters/reflection-element.d.ts +3 -0
- package/build/table/filters/reflection-element.d.ts.map +1 -0
- package/build/table/filters/reflection-element.js +55 -37
- package/build/table/filters/reflection-element.js.map +1 -0
- package/build/table/filters/save-search-modal.d.ts +3 -0
- package/build/table/filters/save-search-modal.d.ts.map +1 -0
- package/build/table/filters/save-search-modal.js +140 -85
- package/build/table/filters/save-search-modal.js.map +1 -0
- package/build/table/filters/scope-element.d.ts +3 -0
- package/build/table/filters/scope-element.d.ts.map +1 -0
- package/build/table/filters/scope-element.js +58 -42
- package/build/table/filters/scope-element.js.map +1 -0
- package/build/table/header-column-content.d.ts +3 -0
- package/build/table/header-column-content.d.ts.map +1 -0
- package/build/table/header-column-content.js +71 -68
- package/build/table/header-column-content.js.map +1 -0
- package/build/table/header-column.d.ts +3 -0
- package/build/table/header-column.d.ts.map +1 -0
- package/build/table/header-column.js +220 -143
- package/build/table/header-column.js.map +1 -0
- package/build/table/header-select.d.ts +3 -0
- package/build/table/header-select.d.ts.map +1 -0
- package/build/table/header-select.js +77 -105
- package/build/table/header-select.js.map +1 -0
- package/build/table/model-callback-args.d.ts +4 -0
- package/build/table/model-callback-args.d.ts.map +1 -0
- package/build/table/model-callback-args.js +43 -9
- package/build/table/model-callback-args.js.map +1 -0
- package/build/table/model-column.d.ts +3 -0
- package/build/table/model-column.d.ts.map +1 -0
- package/build/table/model-column.js +145 -99
- package/build/table/model-column.js.map +1 -0
- package/build/table/model-row.d.ts +3 -0
- package/build/table/model-row.d.ts.map +1 -0
- package/build/table/model-row.js +188 -190
- package/build/table/model-row.js.map +1 -0
- package/build/table/select-calculator.d.ts +2 -0
- package/build/table/select-calculator.d.ts.map +1 -0
- package/build/table/select-calculator.js +110 -59
- package/build/table/select-calculator.js.map +1 -0
- package/build/table/settings/column-row.d.ts +3 -0
- package/build/table/settings/column-row.d.ts.map +1 -0
- package/build/table/settings/column-row.js +188 -95
- package/build/table/settings/column-row.js.map +1 -0
- package/build/table/settings/download-action.d.ts +3 -0
- package/build/table/settings/download-action.d.ts.map +1 -0
- package/build/table/settings/download-action.js +75 -85
- package/build/table/settings/download-action.js.map +1 -0
- package/build/table/settings/index.d.ts +3 -0
- package/build/table/settings/index.d.ts.map +1 -0
- package/build/table/settings/index.js +103 -95
- package/build/table/settings/index.js.map +1 -0
- package/build/table/table-settings.d.ts +35 -0
- package/build/table/table-settings.d.ts.map +1 -0
- package/build/table/table-settings.js +336 -206
- package/build/table/table-settings.js.map +1 -0
- package/build/table/table.d.ts +3 -0
- package/build/table/table.d.ts.map +1 -0
- package/build/table/table.js +801 -964
- package/build/table/table.js.map +1 -0
- package/build/table/use-sorting.d.ts +21 -0
- package/build/table/use-sorting.d.ts.map +1 -0
- package/build/table/use-sorting.js +59 -31
- package/build/table/use-sorting.js.map +1 -0
- package/build/table/widths.d.ts +18 -0
- package/build/table/widths.d.ts.map +1 -0
- package/build/table/widths.js +75 -74
- package/build/table/widths.js.map +1 -0
- package/build/table/worker-plugins-check-all-checkbox.d.ts +3 -0
- package/build/table/worker-plugins-check-all-checkbox.d.ts.map +1 -0
- package/build/table/worker-plugins-check-all-checkbox.js +230 -121
- package/build/table/worker-plugins-check-all-checkbox.js.map +1 -0
- package/build/table/worker-plugins-checkbox.d.ts +3 -0
- package/build/table/worker-plugins-checkbox.d.ts.map +1 -0
- package/build/table/worker-plugins-checkbox.js +186 -112
- package/build/table/worker-plugins-checkbox.js.map +1 -0
- package/build/translated-attributes.d.ts +2 -0
- package/build/translated-attributes.d.ts.map +1 -0
- package/build/translated-attributes.js +13 -8
- package/build/translated-attributes.js.map +1 -0
- package/build/translated-collections.d.ts +4 -0
- package/build/translated-collections.d.ts.map +1 -0
- package/build/translated-collections.js +22 -12
- package/build/translated-collections.js.map +1 -0
- package/build/updated-attribute.d.ts +15 -0
- package/build/updated-attribute.d.ts.map +1 -0
- package/build/updated-attribute.js +144 -72
- package/build/updated-attribute.js.map +1 -0
- package/build/url-encode.d.ts +6 -0
- package/build/url-encode.d.ts.map +1 -0
- package/build/url-encode.js +22 -13
- package/build/url-encode.js.map +1 -0
- package/build/use-breakpoint.d.ts +3 -0
- package/build/use-breakpoint.d.ts.map +1 -0
- package/build/use-breakpoint.js +126 -75
- package/build/use-breakpoint.js.map +1 -0
- package/build/use-can-can.d.ts +8 -0
- package/build/use-can-can.d.ts.map +1 -0
- package/build/use-can-can.js +107 -52
- package/build/use-can-can.js.map +1 -0
- package/build/use-collection.d.ts +73 -0
- package/build/use-collection.d.ts.map +1 -0
- package/build/use-collection.js +366 -215
- package/build/use-collection.js.map +1 -0
- package/build/use-created-event.d.ts +19 -0
- package/build/use-created-event.d.ts.map +1 -0
- package/build/use-created-event.js +73 -50
- package/build/use-created-event.js.map +1 -0
- package/build/use-current-user-context.d.ts +12 -0
- package/build/use-current-user-context.d.ts.map +1 -0
- package/build/use-current-user-context.js +188 -0
- package/build/use-current-user-context.js.map +1 -0
- package/build/use-current-user.d.ts +14 -0
- package/build/use-current-user.d.ts.map +1 -0
- package/build/use-current-user.js +43 -119
- package/build/use-current-user.js.map +1 -0
- package/build/use-destroyed-event.d.ts +16 -0
- package/build/use-destroyed-event.d.ts.map +1 -0
- package/build/use-destroyed-event.js +78 -58
- package/build/use-destroyed-event.js.map +1 -0
- package/build/use-event-emitter.d.ts +9 -0
- package/build/use-event-emitter.d.ts.map +1 -0
- package/build/use-event-emitter.js +32 -25
- package/build/use-event-emitter.js.map +1 -0
- package/build/use-event-listener.d.ts +9 -0
- package/build/use-event-listener.d.ts.map +1 -0
- package/build/use-event-listener.js +36 -21
- package/build/use-event-listener.js.map +1 -0
- package/build/use-input.d.ts +31 -0
- package/build/use-input.d.ts.map +1 -0
- package/build/use-input.js +166 -134
- package/build/use-input.js.map +1 -0
- package/build/use-model-event.d.ts +17 -0
- package/build/use-model-event.d.ts.map +1 -0
- package/build/use-model-event.js +79 -58
- package/build/use-model-event.js.map +1 -0
- package/build/use-model.d.ts +30 -0
- package/build/use-model.d.ts.map +1 -0
- package/build/use-model.js +259 -159
- package/build/use-model.js.map +1 -0
- package/build/use-resize-observer.d.ts +8 -0
- package/build/use-resize-observer.d.ts.map +1 -0
- package/build/use-resize-observer.js +35 -22
- package/build/use-resize-observer.js.map +1 -0
- package/build/use-router.d.ts +8 -0
- package/build/use-router.d.ts.map +1 -0
- package/build/use-router.js +133 -100
- package/build/use-router.js.map +1 -0
- package/build/use-screen-layout.d.ts +3 -0
- package/build/use-screen-layout.d.ts.map +1 -0
- package/build/use-screen-layout.js +46 -37
- package/build/use-screen-layout.js.map +1 -0
- package/build/use-styles.d.ts +2 -0
- package/build/use-styles.d.ts.map +1 -0
- package/build/use-styles.js +99 -47
- package/build/use-styles.js.map +1 -0
- package/build/use-updated-event.d.ts +16 -0
- package/build/use-updated-event.d.ts.map +1 -0
- package/build/use-updated-event.js +79 -58
- package/build/use-updated-event.js.map +1 -0
- package/build/use-validation-errors.d.ts +7 -0
- package/build/use-validation-errors.d.ts.map +1 -0
- package/build/use-validation-errors.js +35 -29
- package/build/use-validation-errors.js.map +1 -0
- package/build/utils/button.d.ts +3 -0
- package/build/utils/button.d.ts.map +1 -0
- package/build/utils/button.js +143 -123
- package/build/utils/button.js.map +1 -0
- package/build/utils/card.d.ts +3 -0
- package/build/utils/card.d.ts.map +1 -0
- package/build/utils/card.js +107 -55
- package/build/utils/card.js.map +1 -0
- package/build/utils/checkbox.d.ts +3 -0
- package/build/utils/checkbox.d.ts.map +1 -0
- package/build/utils/checkbox.js +113 -77
- package/build/utils/checkbox.js.map +1 -0
- package/build/utils/checkboxes.d.ts +3 -0
- package/build/utils/checkboxes.d.ts.map +1 -0
- package/build/utils/checkboxes.js +184 -159
- package/build/utils/checkboxes.js.map +1 -0
- package/build/utils/default-style.d.ts +7 -0
- package/build/utils/default-style.d.ts.map +1 -0
- package/build/utils/default-style.js +129 -62
- package/build/utils/default-style.js.map +1 -0
- package/build/utils/header.d.ts +3 -0
- package/build/utils/header.d.ts.map +1 -0
- package/build/utils/header.js +37 -19
- package/build/utils/header.js.map +1 -0
- package/build/utils/icon.d.ts +3 -0
- package/build/utils/icon.d.ts.map +1 -0
- package/build/utils/icon.js +158 -96
- package/build/utils/icon.js.map +1 -0
- package/build/utils/invalid-feedback.d.ts +3 -0
- package/build/utils/invalid-feedback.d.ts.map +1 -0
- package/build/utils/invalid-feedback.js +43 -19
- package/build/utils/invalid-feedback.js.map +1 -0
- package/build/utils/modal.d.ts +3 -0
- package/build/utils/modal.d.ts.map +1 -0
- package/build/utils/modal.js +118 -61
- package/build/utils/modal.js.map +1 -0
- package/build/utils/text.d.ts +3 -0
- package/build/utils/text.d.ts.map +1 -0
- package/build/utils/text.js +37 -20
- package/build/utils/text.js.map +1 -0
- package/build/validation-error.d.ts +18 -0
- package/build/validation-error.d.ts.map +1 -0
- package/build/validation-error.js +94 -27
- package/build/validation-error.js.map +1 -0
- package/build/validation-errors.d.ts +58 -0
- package/build/validation-errors.d.ts.map +1 -0
- package/build/validation-errors.js +164 -94
- package/build/validation-errors.js.map +1 -0
- package/build/with-api-maker.d.ts +3 -0
- package/build/with-api-maker.d.ts.map +1 -0
- package/build/with-api-maker.js +73 -27
- package/build/with-api-maker.js.map +1 -0
- package/build/with-collection.d.ts +3 -0
- package/build/with-collection.d.ts.map +1 -0
- package/build/with-collection.js +64 -13
- package/build/with-collection.js.map +1 -0
- package/build/with-current-user.d.ts +3 -0
- package/build/with-current-user.d.ts.map +1 -0
- package/build/with-current-user.js +23 -9
- package/build/with-current-user.js.map +1 -0
- package/build/with-model.d.ts +3 -0
- package/build/with-model.d.ts.map +1 -0
- package/build/with-model.js +28 -14
- package/build/with-model.js.map +1 -0
- package/build/with-router.d.ts +3 -0
- package/build/with-router.d.ts.map +1 -0
- package/build/with-router.js +35 -21
- package/build/with-router.js.map +1 -0
- package/package.json +14 -8
- package/.eslintrc.js +0 -357
- package/android/build.gradle +0 -43
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/expo/modules/api_maker/ApiMakerModule.kt +0 -50
- package/android/src/main/java/expo/modules/api_maker/ApiMakerView.kt +0 -30
- package/expo-module.config.json +0 -17
- package/ios/ApiMaker.podspec +0 -29
- package/ios/ApiMakerModule.swift +0 -48
- package/ios/ApiMakerView.swift +0 -38
- package/src/api.js +0 -109
- package/src/attribute-not-loaded-error.js +0 -1
- package/src/base-component.jsx +0 -5
- package/src/base-error.js +0 -38
- package/src/base-model/attribute.js +0 -33
- package/src/base-model/column.js +0 -13
- package/src/base-model/reflection.js +0 -15
- package/src/base-model/scope.js +0 -12
- package/src/base-model.js +0 -1001
- package/src/bootstrap/attribute-row.jsx +0 -134
- package/src/bootstrap/attribute-rows.jsx +0 -27
- package/src/bootstrap/card.jsx +0 -149
- package/src/bootstrap/checkbox.jsx +0 -86
- package/src/bootstrap/checkboxes.jsx +0 -185
- package/src/bootstrap/index.js +0 -0
- package/src/bootstrap/input.jsx +0 -173
- package/src/bootstrap/invalid-feedback.jsx +0 -31
- package/src/bootstrap/paginate.jsx +0 -187
- package/src/bootstrap/radio-buttons.jsx +0 -87
- package/src/bootstrap/select.jsx +0 -110
- package/src/bootstrap/sort-link.jsx +0 -106
- package/src/cable-connection-pool.js +0 -127
- package/src/cable-subscription-pool.js +0 -189
- package/src/cable-subscription.js +0 -23
- package/src/cache-key-generator.js +0 -100
- package/src/can-can.js +0 -158
- package/src/channels-consumer.js +0 -10
- package/src/collection-loader.jsx +0 -60
- package/src/collection.js +0 -346
- package/src/command-submit-data.js +0 -103
- package/src/commands-pool.js +0 -212
- package/src/compose.js +0 -11
- package/src/config.js +0 -71
- package/src/custom-error.js +0 -7
- package/src/data-set-to-attributes.js +0 -13
- package/src/deserializer.js +0 -60
- package/src/destroy-error.js +0 -7
- package/src/devise.js +0 -151
- package/src/draggable-sort/controller.js +0 -137
- package/src/draggable-sort/index.jsx +0 -107
- package/src/draggable-sort/item.jsx +0 -171
- package/src/error-logger.js +0 -111
- package/src/error-messages.js +0 -15
- package/src/event-connection.jsx +0 -37
- package/src/event-emitter-listener.jsx +0 -13
- package/src/event-model-class.jsx +0 -28
- package/src/events.js +0 -7
- package/src/form.jsx +0 -110
- package/src/history-expo.js +0 -23
- package/src/history-react-native.js +0 -25
- package/src/history.js +0 -3
- package/src/index.js +0 -3
- package/src/inputs/attachment.jsx +0 -108
- package/src/inputs/auto-submit.js +0 -37
- package/src/inputs/checkbox.jsx +0 -125
- package/src/inputs/checkboxes.jsx +0 -116
- package/src/inputs/id-for-component.js +0 -15
- package/src/inputs/input-wrapper.jsx +0 -16
- package/src/inputs/input.jsx +0 -260
- package/src/inputs/money.jsx +0 -179
- package/src/inputs/name-for-component.js +0 -15
- package/src/inputs/select.jsx +0 -104
- package/src/instance-of-class-name.js +0 -29
- package/src/is-expo.js +0 -18
- package/src/key-value-store.js +0 -68
- package/src/link.jsx +0 -77
- package/src/logger.js +0 -38
- package/src/merge-styles.js +0 -15
- package/src/modal.jsx +0 -37
- package/src/model-class-require.js +0 -17
- package/src/model-events.js +0 -39
- package/src/model-name.js +0 -33
- package/src/model-prop-type.js +0 -124
- package/src/model-recipes-loader.js +0 -28
- package/src/model-recipes-model-loader.js +0 -350
- package/src/models-response-reader.js +0 -48
- package/src/models.js +0 -7
- package/src/models.js.erb +0 -19
- package/src/money-formatter.js +0 -100
- package/src/not-loaded-error.js +0 -1
- package/src/params.js +0 -66
- package/src/preloaded.js +0 -43
- package/src/resize-observer.jsx +0 -10
- package/src/rest-props-validator.js +0 -9
- package/src/result.js +0 -13
- package/src/router/route.jsx +0 -246
- package/src/router/switch.jsx +0 -76
- package/src/router.jsx +0 -47
- package/src/routes-native.js +0 -173
- package/src/routes.js +0 -58
- package/src/run-last.js +0 -39
- package/src/serializer.js +0 -76
- package/src/services.js +0 -23
- package/src/session-status-updater.js +0 -172
- package/src/source-maps-loader.js +0 -203
- package/src/super-admin/config-reader.jsx +0 -93
- package/src/super-admin/edit-page/edit-attribute-checkbox.jsx +0 -84
- package/src/super-admin/edit-page/edit-attribute-content.jsx +0 -57
- package/src/super-admin/edit-page/edit-attribute-input.jsx +0 -79
- package/src/super-admin/edit-page/edit-attribute.jsx +0 -84
- package/src/super-admin/edit-page.jsx +0 -117
- package/src/super-admin/has-edit-config.js +0 -15
- package/src/super-admin/index-page.jsx +0 -23
- package/src/super-admin/index.jsx +0 -219
- package/src/super-admin/layout/header/index.jsx +0 -144
- package/src/super-admin/layout/header/style.scss +0 -45
- package/src/super-admin/layout/index.jsx +0 -154
- package/src/super-admin/layout/menu/index.jsx +0 -173
- package/src/super-admin/layout/menu/menu-content.jsx +0 -43
- package/src/super-admin/layout/menu/menu-item.jsx +0 -70
- package/src/super-admin/layout/menu/style.scss +0 -11
- package/src/super-admin/layout/no-access.jsx +0 -26
- package/src/super-admin/model-class-table.jsx +0 -66
- package/src/super-admin/models.js +0 -11
- package/src/super-admin/show-nav.jsx +0 -45
- package/src/super-admin/show-page/belongs-to-attribute-row.jsx +0 -30
- package/src/super-admin/show-page/index.jsx +0 -141
- package/src/super-admin/show-reflection-actions.jsx +0 -55
- package/src/super-admin/show-reflection-link.jsx +0 -40
- package/src/super-admin/show-reflection-page.jsx +0 -50
- package/src/super-admin/stylesheets/variables.scss +0 -11
- package/src/table/column-content.jsx +0 -122
- package/src/table/column-identifier.js +0 -23
- package/src/table/column-visible.js +0 -7
- package/src/table/components/column.jsx +0 -19
- package/src/table/components/flat-list.jsx +0 -19
- package/src/table/components/header.jsx +0 -21
- package/src/table/components/row.jsx +0 -23
- package/src/table/filters/attribute-element.jsx +0 -47
- package/src/table/filters/filter-form.jsx +0 -448
- package/src/table/filters/filter.jsx +0 -74
- package/src/table/filters/index.jsx +0 -171
- package/src/table/filters/load-search-modal.jsx +0 -157
- package/src/table/filters/reflection-element.jsx +0 -38
- package/src/table/filters/save-search-modal.jsx +0 -74
- package/src/table/filters/scope-element.jsx +0 -44
- package/src/table/header-column-content.jsx +0 -55
- package/src/table/header-column.jsx +0 -129
- package/src/table/header-select.jsx +0 -78
- package/src/table/model-callback-args.js +0 -10
- package/src/table/model-column.jsx +0 -86
- package/src/table/model-row.jsx +0 -140
- package/src/table/select-calculator.js +0 -65
- package/src/table/settings/column-row.jsx +0 -93
- package/src/table/settings/download-action.jsx +0 -73
- package/src/table/settings/index.jsx +0 -66
- package/src/table/table-settings.js +0 -262
- package/src/table/table.jsx +0 -957
- package/src/table/use-sorting.js +0 -35
- package/src/table/variables.scss +0 -11
- package/src/table/widths.jsx +0 -87
- package/src/table/worker-plugins-check-all-checkbox.jsx +0 -112
- package/src/table/worker-plugins-checkbox.jsx +0 -104
- package/src/translated-attributes.js +0 -11
- package/src/translated-collections-data.js.erb +0 -5
- package/src/translated-collections.js +0 -13
- package/src/updated-attribute.jsx +0 -93
- package/src/url-encode.js +0 -18
- package/src/use-breakpoint.js +0 -100
- package/src/use-can-can.js +0 -55
- package/src/use-collection.js +0 -280
- package/src/use-created-event.js +0 -55
- package/src/use-current-user.js +0 -133
- package/src/use-destroyed-event.js +0 -60
- package/src/use-event-emitter.js +0 -25
- package/src/use-event-listener.js +0 -23
- package/src/use-input.js +0 -159
- package/src/use-model-event.js +0 -60
- package/src/use-model.js +0 -189
- package/src/use-resize-observer.js +0 -24
- package/src/use-router.jsx +0 -128
- package/src/use-screen-layout.js +0 -49
- package/src/use-styles.js +0 -66
- package/src/use-updated-event.js +0 -60
- package/src/use-validation-errors.js +0 -33
- package/src/utils/button.jsx +0 -127
- package/src/utils/card.jsx +0 -58
- package/src/utils/checkbox.jsx +0 -73
- package/src/utils/checkboxes.jsx +0 -157
- package/src/utils/default-style.jsx +0 -80
- package/src/utils/header.jsx +0 -14
- package/src/utils/icon.jsx +0 -81
- package/src/utils/invalid-feedback.jsx +0 -20
- package/src/utils/modal.jsx +0 -64
- package/src/utils/text.jsx +0 -15
- package/src/validation-error.js +0 -35
- package/src/validation-errors.js +0 -121
- package/src/with-api-maker.jsx +0 -31
- package/src/with-collection.jsx +0 -17
- package/src/with-current-user.jsx +0 -10
- package/src/with-model.jsx +0 -16
- package/src/with-router.jsx +0 -11
package/src/params.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import config from "./config"
|
|
2
|
-
import formSerialize from "form-serialize"
|
|
3
|
-
import Incorporator from "incorporator"
|
|
4
|
-
import qs from "qs"
|
|
5
|
-
import urlEncode from "./url-encode"
|
|
6
|
-
|
|
7
|
-
export default class Params {
|
|
8
|
-
static parse() {
|
|
9
|
-
return qs.parse(globalThis.location.search.substr(1))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
static change(given) {
|
|
13
|
-
const incorporator = new Incorporator({objects: [Params.parse(), given]})
|
|
14
|
-
|
|
15
|
-
incorporator.replaceArrayIfExists(true)
|
|
16
|
-
|
|
17
|
-
return incorporator.merge()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static withParams(params) {
|
|
21
|
-
const newParams = qs.stringify(params, {encoder: urlEncode})
|
|
22
|
-
const newPath = `${location.pathname}?${newParams}`
|
|
23
|
-
|
|
24
|
-
return newPath
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static changeParams(given, opts = {}) {
|
|
28
|
-
const params = Params.change(given)
|
|
29
|
-
const newParams = qs.stringify(params, {encoder: urlEncode})
|
|
30
|
-
const newPath = `${location.pathname}?${newParams}`
|
|
31
|
-
const appHistory = opts.appHistory || config.getHistory()
|
|
32
|
-
|
|
33
|
-
if (!appHistory) throw new Error("AppHistory hasn't been set in the ApiMaker configuration")
|
|
34
|
-
|
|
35
|
-
appHistory.push(newPath)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static serializeForm(form) {
|
|
39
|
-
const hash = formSerialize(form, {empty: true, hash: true})
|
|
40
|
-
return Params.setUndefined(hash)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// This is used to set all empty values to 'undefined' which makes qs removed those elements from the query string
|
|
44
|
-
static setUndefined(given) {
|
|
45
|
-
if (Array.isArray(given)) {
|
|
46
|
-
if (given.length == 0)
|
|
47
|
-
return undefined
|
|
48
|
-
|
|
49
|
-
return given.map((givenI) => Params.setUndefined(givenI))
|
|
50
|
-
} else if (typeof given === "object") {
|
|
51
|
-
if (Object.keys(given).length == 0)
|
|
52
|
-
return undefined
|
|
53
|
-
|
|
54
|
-
const newGiven = {}
|
|
55
|
-
for (const key in given) {
|
|
56
|
-
newGiven[key] = Params.setUndefined(given[key])
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return newGiven
|
|
60
|
-
} else if (given === "") {
|
|
61
|
-
return undefined
|
|
62
|
-
} else {
|
|
63
|
-
return given
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
package/src/preloaded.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as inflection from "inflection"
|
|
2
|
-
import modelClassRequire from "./model-class-require"
|
|
3
|
-
|
|
4
|
-
export default class ApiMakerPreloaded {
|
|
5
|
-
constructor (response) {
|
|
6
|
-
this.response = response
|
|
7
|
-
this.loadPreloadedModels()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
loadPreloadedModels () {
|
|
11
|
-
this.preloaded = {}
|
|
12
|
-
|
|
13
|
-
for (const preloadedType in this.response.preloaded) {
|
|
14
|
-
const modelClassName = inflection.classify(preloadedType)
|
|
15
|
-
const ModelClass = modelClassRequire(modelClassName)
|
|
16
|
-
|
|
17
|
-
for (const preloadedId in this.response.preloaded[preloadedType]) {
|
|
18
|
-
const preloadedData = this.response.preloaded[preloadedType][preloadedId]
|
|
19
|
-
const model = new ModelClass({data: preloadedData, isNewRecord: false})
|
|
20
|
-
|
|
21
|
-
if (!this.preloaded[preloadedType]) {
|
|
22
|
-
this.preloaded[preloadedType] = {}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
this.preloaded[preloadedType][preloadedId] = model
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
for (const modelType in this.preloaded) {
|
|
30
|
-
for (const modelId in this.preloaded[modelType]) {
|
|
31
|
-
this.preloaded[modelType][modelId]._readPreloadedRelationships(this)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
getModel (type, id) {
|
|
37
|
-
if (!this.preloaded[type] || !this.preloaded[type][id]) {
|
|
38
|
-
throw new Error(`Could not find a ${type} by that ID: ${id}`)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return this.preloaded[type][id]
|
|
42
|
-
}
|
|
43
|
-
}
|
package/src/resize-observer.jsx
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import memo from "set-state-compare/src/memo"
|
|
2
|
-
import useResizeObserver from "./use-resize-observer"
|
|
3
|
-
|
|
4
|
-
const ApiMakerResizeObserver = memo(({element, onResize}) => {
|
|
5
|
-
useResizeObserver(element, onResize)
|
|
6
|
-
|
|
7
|
-
return null
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export default ApiMakerResizeObserver
|
package/src/result.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default class ApiMakerResult {
|
|
2
|
-
constructor (data) {
|
|
3
|
-
this.data = data
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
count = () => this.data.response.meta.count
|
|
7
|
-
currentPage = () => this.data.response.meta.currentPage
|
|
8
|
-
models = () => this.data.models
|
|
9
|
-
modelClass = () => this.data.collection.modelClass()
|
|
10
|
-
perPage = () => this.data.response.meta.perPage
|
|
11
|
-
totalCount = () => this.data.response.meta.totalCount
|
|
12
|
-
totalPages = () => this.data.response.meta.totalPages
|
|
13
|
-
}
|
package/src/router/route.jsx
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import BaseComponent from "../base-component"
|
|
2
|
-
import React, {createContext, useContext, useMemo} from "react"
|
|
3
|
-
import memo from "set-state-compare/src/memo"
|
|
4
|
-
import PropTypes from "prop-types"
|
|
5
|
-
import propTypesExact from "prop-types-exact"
|
|
6
|
-
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
7
|
-
import Switch, {CurrentSwitchContext} from "./switch"
|
|
8
|
-
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
9
|
-
|
|
10
|
-
const CurrentPathContext = createContext([])
|
|
11
|
-
const ParamsContext = createContext({})
|
|
12
|
-
const RequireComponentContext = createContext(null)
|
|
13
|
-
const RouteContext = createContext(null)
|
|
14
|
-
const useParams = () => useContext(ParamsContext)
|
|
15
|
-
|
|
16
|
-
const Route = memo(shapeComponent(class Route extends BaseComponent {
|
|
17
|
-
static defaultProps = {
|
|
18
|
-
exact: false,
|
|
19
|
-
fallback: false,
|
|
20
|
-
includeInPath: true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static propTypes = propTypesExact({
|
|
24
|
-
children: PropTypes.any,
|
|
25
|
-
component: PropTypes.string,
|
|
26
|
-
componentPath: PropTypes.string,
|
|
27
|
-
exact: PropTypes.bool.isRequired,
|
|
28
|
-
fallback: PropTypes.bool.isRequired,
|
|
29
|
-
includeInPath: PropTypes.bool.isRequired,
|
|
30
|
-
onMatch: PropTypes.func,
|
|
31
|
-
path: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(RegExp)])
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
match = null
|
|
35
|
-
newParams = null
|
|
36
|
-
pathParts = null
|
|
37
|
-
|
|
38
|
-
setup() {
|
|
39
|
-
const {t} = useI18n({namespace: "js.api_maker.router.route"})
|
|
40
|
-
const {path} = this.props
|
|
41
|
-
const {pathsMatched, switchGroup} = useContext(CurrentSwitchContext)
|
|
42
|
-
const givenRoute = useContext(RouteContext)
|
|
43
|
-
const {pathShown} = switchGroup.s
|
|
44
|
-
|
|
45
|
-
this.debug = false
|
|
46
|
-
this.log(() => ({givenRoute}))
|
|
47
|
-
this.t = t
|
|
48
|
-
|
|
49
|
-
this.requireComponent = useContext(RequireComponentContext)
|
|
50
|
-
this.currentParams = useContext(ParamsContext)
|
|
51
|
-
this.currentPath = useContext(CurrentPathContext)
|
|
52
|
-
this.switchGroup = switchGroup
|
|
53
|
-
this.routeParts = useMemo(() => givenRoute?.split("/"), [path, givenRoute])
|
|
54
|
-
this.pathParts = useMemo(() => path?.split("/"), [path])
|
|
55
|
-
|
|
56
|
-
this.newRouteParts = useMemo(
|
|
57
|
-
() => {
|
|
58
|
-
if (!path) {
|
|
59
|
-
if (givenRoute == "") {
|
|
60
|
-
return []
|
|
61
|
-
} else {
|
|
62
|
-
return this.routeParts
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return this.routeParts.slice(this.pathParts.length, this.routeParts.length)
|
|
67
|
-
},
|
|
68
|
-
[givenRoute].concat(this.pathParts)
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
this.useStates({Component: null, componentNotFound: null, matches: false})
|
|
72
|
-
|
|
73
|
-
useMemo(() => {
|
|
74
|
-
this.loadMatches()
|
|
75
|
-
}, [givenRoute, path, pathsMatched])
|
|
76
|
-
|
|
77
|
-
useMemo(() => {
|
|
78
|
-
if (this.hasSwitchMatch() && !this.s.Component && this.s.matches) {
|
|
79
|
-
if (this.props.onMatch) {
|
|
80
|
-
this.props.onMatch()
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!this.props.children && (this.props.path || this.props.component || this.props.componentPath)) {
|
|
84
|
-
this.loadComponent()
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}, [path, pathShown, this.s.matches])
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
hasSwitchMatch = () => this.switchGroup.s.pathShown && this.switchGroup.s.pathShown == this.pathId()
|
|
91
|
-
|
|
92
|
-
pathId() {
|
|
93
|
-
const {fallback} = this.p
|
|
94
|
-
const {path} = this.props
|
|
95
|
-
let pathId
|
|
96
|
-
|
|
97
|
-
if (fallback) {
|
|
98
|
-
pathId = "[FALLBACK]"
|
|
99
|
-
} else if (!path) {
|
|
100
|
-
pathId = "[PATH-EMPTY]"
|
|
101
|
-
} else {
|
|
102
|
-
pathId = path
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return pathId
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
loadMatches() {
|
|
109
|
-
const {newRouteParts, t} = this.tt
|
|
110
|
-
const {component, path} = this.props
|
|
111
|
-
const {exact, includeInPath, fallback} = this.p
|
|
112
|
-
|
|
113
|
-
let matches = true
|
|
114
|
-
const params = {}
|
|
115
|
-
const componentPathParts = [...this.currentPath]
|
|
116
|
-
|
|
117
|
-
this.log(() => [this.props.path, "Start generating component paths", JSON.stringify(componentPathParts)])
|
|
118
|
-
|
|
119
|
-
for (const pathPartIndex in this.pathParts) {
|
|
120
|
-
const pathPart = this.pathParts[pathPartIndex]
|
|
121
|
-
const translatedPathPart = t(`routes.${pathPart}`, {defaultValue: pathPart})
|
|
122
|
-
|
|
123
|
-
if (!(pathPartIndex in this.routeParts)) {
|
|
124
|
-
this.log(() => `No match for: ${pathPartIndex}`)
|
|
125
|
-
matches = false
|
|
126
|
-
break
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const routePart = decodeURIComponent(this.routeParts[pathPartIndex])
|
|
130
|
-
|
|
131
|
-
if (pathPart.startsWith(":") && routePart) {
|
|
132
|
-
const paramName = pathPart.slice(1, pathPart.length)
|
|
133
|
-
|
|
134
|
-
params[paramName] = routePart
|
|
135
|
-
} else if (translatedPathPart != routePart) {
|
|
136
|
-
matches = false
|
|
137
|
-
break
|
|
138
|
-
} else if (!component && includeInPath) {
|
|
139
|
-
componentPathParts.push(pathPart)
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (exact && newRouteParts.length > 0) {
|
|
144
|
-
this.log(() => ["Exact and more route parts", {newRouteParts, pathParts: this.pathParts, routeParts: this.routeParts}])
|
|
145
|
-
matches = false
|
|
146
|
-
} else if (matches && path) {
|
|
147
|
-
matches = true
|
|
148
|
-
} else if (this.routeParts.length == 0) {
|
|
149
|
-
matches = true
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const matchId = this.pathId()
|
|
153
|
-
|
|
154
|
-
if (!matches && fallback) {
|
|
155
|
-
matches = true
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
this.log(() => [this.props.path, "End generating component paths", JSON.stringify(componentPathParts), {matches}])
|
|
159
|
-
|
|
160
|
-
if (matches) {
|
|
161
|
-
if (component && includeInPath) {
|
|
162
|
-
componentPathParts.push(component)
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const newParams = Object.assign({}, this.currentParams, params)
|
|
166
|
-
|
|
167
|
-
this.setInstance({componentPathParts, match: {params}, newParams})
|
|
168
|
-
this.setState({matches})
|
|
169
|
-
this.switchGroup?.setPathMatched(matchId, true)
|
|
170
|
-
} else {
|
|
171
|
-
this.setInstance({componentPathParts: null, match: null, newParams: null})
|
|
172
|
-
this.setState({matches})
|
|
173
|
-
this.switchGroup?.setPathMatched(matchId, false)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
async loadComponent() {
|
|
178
|
-
const actualComponentPath = this.props.componentPath || this.tt.componentPathParts.join("/")
|
|
179
|
-
let Component
|
|
180
|
-
|
|
181
|
-
this.log(() => ["loadComponent", {componentPath: this.props.componentPath, componentPathParts: this.componentPathParts, actualComponentPath}])
|
|
182
|
-
|
|
183
|
-
try {
|
|
184
|
-
const componentImport = await this.tt.requireComponent({routeDefinition: {component: actualComponentPath}})
|
|
185
|
-
|
|
186
|
-
Component = componentImport
|
|
187
|
-
} catch (error) {
|
|
188
|
-
console.error(`Couldn't find component: ${actualComponentPath}`)
|
|
189
|
-
|
|
190
|
-
throw error
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
this.setState({Component, componentNotFound: !Component})
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
log(callbackArgs) {
|
|
197
|
-
if (this.debug) {
|
|
198
|
-
let args = callbackArgs()
|
|
199
|
-
|
|
200
|
-
if (!Array.isArray(args)) args = [args]
|
|
201
|
-
|
|
202
|
-
console.log(...args)
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
render() {
|
|
207
|
-
const {componentPathParts, match, newParams, newRouteParts} = this.tt
|
|
208
|
-
const {children, component, path} = this.props
|
|
209
|
-
const {Component, componentNotFound, matches} = this.s
|
|
210
|
-
|
|
211
|
-
if (!matches || !this.hasSwitchMatch()) {
|
|
212
|
-
// Route isn't matching and shouldn't be rendered at all.
|
|
213
|
-
return null
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (!Component && !children && !componentNotFound) {
|
|
217
|
-
// Route is matching but hasn't been loaded yet.
|
|
218
|
-
return (
|
|
219
|
-
<div>
|
|
220
|
-
Loading {component || this.props.componentPath || componentPathParts.join("/")}
|
|
221
|
-
</div>
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (!Component && !children && componentNotFound) {
|
|
226
|
-
// Don't render anything if the component couldn't be found.
|
|
227
|
-
return null
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return (
|
|
231
|
-
<CurrentPathContext.Provider value={componentPathParts}>
|
|
232
|
-
<RouteContext.Provider value={newRouteParts.join("/")}>
|
|
233
|
-
<ParamsContext.Provider value={newParams}>
|
|
234
|
-
<Switch name={`route-group-${path}`} single={false}>
|
|
235
|
-
{Component && <Component match={match} />}
|
|
236
|
-
{children}
|
|
237
|
-
</Switch>
|
|
238
|
-
</ParamsContext.Provider>
|
|
239
|
-
</RouteContext.Provider>
|
|
240
|
-
</CurrentPathContext.Provider>
|
|
241
|
-
)
|
|
242
|
-
}
|
|
243
|
-
}))
|
|
244
|
-
|
|
245
|
-
export {RequireComponentContext, RouteContext, Switch, useParams}
|
|
246
|
-
export default Route
|
package/src/router/switch.jsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import BaseComponent from "../base-component"
|
|
2
|
-
import React, {createContext} from "react"
|
|
3
|
-
import memo from "set-state-compare/src/memo"
|
|
4
|
-
import PropTypes from "prop-types"
|
|
5
|
-
import propTypesExact from "prop-types-exact"
|
|
6
|
-
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
7
|
-
|
|
8
|
-
const CurrentSwitchContext = createContext([])
|
|
9
|
-
|
|
10
|
-
const Switch = memo(shapeComponent(class Switch extends BaseComponent {
|
|
11
|
-
static defaultProps = {
|
|
12
|
-
name: "[no name]",
|
|
13
|
-
single: true
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
static propTypes = propTypesExact({
|
|
17
|
-
children: PropTypes.any,
|
|
18
|
-
name: PropTypes.string,
|
|
19
|
-
single: PropTypes.bool
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
pathsMatchedKeys = []
|
|
23
|
-
|
|
24
|
-
setup() {
|
|
25
|
-
this.useStates({
|
|
26
|
-
lastUpdate: new Date(),
|
|
27
|
-
pathShown: undefined,
|
|
28
|
-
pathsMatched: {}
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
render() {
|
|
33
|
-
const {pathShown, pathsMatched} = this.s
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<CurrentSwitchContext.Provider value={{pathShown, pathsMatched, switchGroup: this}}>
|
|
37
|
-
{this.props.children}
|
|
38
|
-
</CurrentSwitchContext.Provider>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
pathShown(pathsMatched) {
|
|
43
|
-
for (const pathMatched of this.tt.pathsMatchedKeys) {
|
|
44
|
-
const isPathMatched = pathsMatched[pathMatched]
|
|
45
|
-
|
|
46
|
-
if (isPathMatched) {
|
|
47
|
-
return pathMatched
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setPathMatched(path, matched) {
|
|
53
|
-
const {pathsMatchedKeys} = this.tt
|
|
54
|
-
const {pathsMatched} = this.s
|
|
55
|
-
|
|
56
|
-
if (!path) throw new Error("No 'path' given")
|
|
57
|
-
if (pathsMatched[path] == matched) return
|
|
58
|
-
|
|
59
|
-
if (!pathsMatchedKeys.includes(path)) {
|
|
60
|
-
pathsMatchedKeys.push(path)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const newPathsMatched = {...this.s.pathsMatched}
|
|
64
|
-
|
|
65
|
-
newPathsMatched[path] = matched
|
|
66
|
-
|
|
67
|
-
this.setState({
|
|
68
|
-
lastUpdate: Math.random() + new Date().getTime(),
|
|
69
|
-
pathShown: this.pathShown(newPathsMatched),
|
|
70
|
-
pathsMatched: newPathsMatched
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
}))
|
|
74
|
-
|
|
75
|
-
export {CurrentSwitchContext}
|
|
76
|
-
export default Switch
|
package/src/router.jsx
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import BaseComponent from "./base-component"
|
|
2
|
-
import PropTypes from "prop-types"
|
|
3
|
-
import propTypesExact from "prop-types-exact"
|
|
4
|
-
import React, {memo, Suspense} from "react"
|
|
5
|
-
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
6
|
-
import usePath from "on-location-changed/build/use-path"
|
|
7
|
-
import useRouter from "./use-router"
|
|
8
|
-
|
|
9
|
-
export default memo(shapeComponent(class ApiMakerRouter extends BaseComponent {
|
|
10
|
-
static propTypes = propTypesExact({
|
|
11
|
-
history: PropTypes.object,
|
|
12
|
-
locales: PropTypes.array.isRequired,
|
|
13
|
-
notFoundComponent: PropTypes.elementType,
|
|
14
|
-
requireComponent: PropTypes.func.isRequired,
|
|
15
|
-
routeDefinitions: PropTypes.object,
|
|
16
|
-
routes: PropTypes.object
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
render() {
|
|
20
|
-
const path = usePath()
|
|
21
|
-
const {locales, notFoundComponent, requireComponent, routeDefinitions, routes} = this.props
|
|
22
|
-
const {match} = useRouter({locales, path, routes, routeDefinitions})
|
|
23
|
-
const {matchingRoute} = match
|
|
24
|
-
|
|
25
|
-
if (!matchingRoute) {
|
|
26
|
-
if (notFoundComponent) {
|
|
27
|
-
const NotFoundComponent = notFoundComponent
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<Suspense fallback={<div />}>
|
|
31
|
-
<NotFoundComponent match={match} />
|
|
32
|
-
</Suspense>
|
|
33
|
-
)
|
|
34
|
-
} else {
|
|
35
|
-
return null
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const Component = requireComponent({routeDefinition: matchingRoute.parsedRouteDefinition.routeDefinition})
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Suspense fallback={<div />}>
|
|
43
|
-
<Component match={match} />
|
|
44
|
-
</Suspense>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
}))
|
package/src/routes-native.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import {dig, digg, digs} from "diggerize"
|
|
2
|
-
import * as inflection from "inflection"
|
|
3
|
-
import qs from "qs"
|
|
4
|
-
import urlEncode from "./url-encode"
|
|
5
|
-
|
|
6
|
-
export default class ApiMakerRoutesNative {
|
|
7
|
-
constructor ({getLocale}) {
|
|
8
|
-
this.getLocale = getLocale
|
|
9
|
-
this.routeDefinitions = []
|
|
10
|
-
this.routeTranslationParts = {}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
loadRouteDefinitions (routeDefinitions, routeDefinitionArgs) {
|
|
14
|
-
for (const routeDefinition of digg(routeDefinitions, "routes")) {
|
|
15
|
-
const {name, path} = digs(routeDefinition, "name", "path")
|
|
16
|
-
const rawPathParts = path.split("/")
|
|
17
|
-
const pathMethodName = `${inflection.camelize(name, true)}Path`
|
|
18
|
-
const urlMethodName = `${inflection.camelize(name, true)}Url`
|
|
19
|
-
|
|
20
|
-
if (routeDefinitionArgs && routeDefinitionArgs.localized) {
|
|
21
|
-
const localizedRoutes = {}
|
|
22
|
-
|
|
23
|
-
for (const locale in this.routeTranslationParts) {
|
|
24
|
-
let variableCount = 0
|
|
25
|
-
|
|
26
|
-
const localizedPathParts = [
|
|
27
|
-
{type: "pathPart", name: ""},
|
|
28
|
-
{type: "pathPart", name: locale}
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
for (let i = 1; i < rawPathParts.length; i++) {
|
|
32
|
-
const pathPart = rawPathParts[i]
|
|
33
|
-
const variableMatch = pathPart.match(/^:([A-z_]+)$/)
|
|
34
|
-
|
|
35
|
-
if (variableMatch) {
|
|
36
|
-
localizedPathParts.push({type: "variable", count: variableCount++})
|
|
37
|
-
} else if (pathPart) {
|
|
38
|
-
const name = this.i18n.t(`routes.${pathPart}`, null, {default: pathPart, locale})
|
|
39
|
-
|
|
40
|
-
localizedPathParts.push({type: "pathPart", name})
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
localizedRoutes[locale] = localizedPathParts
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
this[pathMethodName] = (...args) => this.translateRoute({args, localizedRoutes})
|
|
48
|
-
this[urlMethodName] = (...args) => this.translateRoute({args, localizedRoutes, url: true})
|
|
49
|
-
} else {
|
|
50
|
-
let variableCount = 0
|
|
51
|
-
|
|
52
|
-
const pathParts = rawPathParts.map((pathPart) => {
|
|
53
|
-
const variableMatch = pathPart.match(/^:([A-z_]+)$/)
|
|
54
|
-
|
|
55
|
-
if (variableMatch) {
|
|
56
|
-
return {type: "variable", count: variableCount}
|
|
57
|
-
} else {
|
|
58
|
-
return {type: "pathPart", name: pathPart}
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
this[pathMethodName] = (...args) => this.translateRoute({args, pathParts})
|
|
63
|
-
this[urlMethodName] = (...args) => this.translateRoute({args, pathParts, url: true})
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
loadRouteTranslations (i18n) {
|
|
69
|
-
this.i18n = i18n
|
|
70
|
-
const locales = digg(i18n, "locales")
|
|
71
|
-
|
|
72
|
-
for (const locale in locales) {
|
|
73
|
-
const routeTranslations = dig(locales, locale, "routes")
|
|
74
|
-
|
|
75
|
-
if (!routeTranslations) continue
|
|
76
|
-
if (!(locale in this.routeTranslationParts)) this.routeTranslationParts[locale] = {}
|
|
77
|
-
|
|
78
|
-
for (const key in routeTranslations) {
|
|
79
|
-
this.routeTranslationParts[locale][key] = routeTranslations[key]
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
translateRoute ({args, localizedRoutes, pathParts, url}) {
|
|
85
|
-
let options
|
|
86
|
-
|
|
87
|
-
// Extract options from args if any
|
|
88
|
-
const lastArg = args[args.length - 1]
|
|
89
|
-
|
|
90
|
-
if (lastArg && typeof lastArg == "object") {
|
|
91
|
-
options = args.pop()
|
|
92
|
-
} else {
|
|
93
|
-
options = {}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Take locale from options if given or fall back to fallback
|
|
97
|
-
const {locale, host, port, protocol, ...restOptions} = options
|
|
98
|
-
|
|
99
|
-
if (localizedRoutes) {
|
|
100
|
-
// Put together route with variables and static translated parts (which were translated and cached previously)
|
|
101
|
-
let translatedRoute = digg(localizedRoutes, locale || this.getLocale())
|
|
102
|
-
.map((pathPart) => {
|
|
103
|
-
if (pathPart.type == "pathPart") {
|
|
104
|
-
return pathPart.name
|
|
105
|
-
} else if (pathPart.type == "variable") {
|
|
106
|
-
// Args might not contain the right amount of variables, so dont change this to 'digg'
|
|
107
|
-
return dig(args, digg(pathPart, "count"))
|
|
108
|
-
} else {
|
|
109
|
-
throw new Error(`Unhandled path part type: ${pathPart.type}`)
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
.join("/")
|
|
113
|
-
|
|
114
|
-
if (restOptions && Object.keys(restOptions).length > 0) {
|
|
115
|
-
translatedRoute += `?${qs.stringify(restOptions, {encoder: urlEncode})}`
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (url) return this.addHostToRoute({host, port, protocol, translatedRoute})
|
|
119
|
-
|
|
120
|
-
return translatedRoute
|
|
121
|
-
} else if (pathParts) {
|
|
122
|
-
// Put together route with variables and static translated parts (which were translated and cached previously)
|
|
123
|
-
let translatedRoute = pathParts
|
|
124
|
-
.map((pathPart) => {
|
|
125
|
-
if (pathPart.type == "pathPart") {
|
|
126
|
-
return pathPart.name
|
|
127
|
-
} else if (pathPart.type == "variable") {
|
|
128
|
-
return digg(args, digg(pathPart, "count"))
|
|
129
|
-
} else {
|
|
130
|
-
throw new Error(`Unhandled path part type: ${pathPart.type}`)
|
|
131
|
-
}
|
|
132
|
-
})
|
|
133
|
-
.join("/")
|
|
134
|
-
|
|
135
|
-
if (restOptions && Object.keys(restOptions).length > 0) {
|
|
136
|
-
translatedRoute += `?${qs.stringify(restOptions, {encoder: urlEncode})}`
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (url) return this.addHostToRoute({host, port, protocol, translatedRoute})
|
|
140
|
-
|
|
141
|
-
return translatedRoute
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
throw new Error("Unhandled state")
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
addHostToRoute ({host, port, protocol, translatedRoute}) {
|
|
148
|
-
let fullUrl = ""
|
|
149
|
-
|
|
150
|
-
const hostToUse = host || globalThis.location && globalThis.location.host
|
|
151
|
-
const portToUse = port || globalThis.location && globalThis.location.port
|
|
152
|
-
|
|
153
|
-
if (!hostToUse) throw new Error("Unable to detect host")
|
|
154
|
-
|
|
155
|
-
if (protocol) {
|
|
156
|
-
fullUrl += `${protocol}://`
|
|
157
|
-
} else if (globalThis.location && globalThis.location.protocol) {
|
|
158
|
-
fullUrl += `${globalThis.location.protocol}//`
|
|
159
|
-
} else {
|
|
160
|
-
fullUrl += "https://"
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
fullUrl += hostToUse
|
|
164
|
-
|
|
165
|
-
if (portToUse && ((protocol == "http" && portToUse != 80) || (protocol == "https" && port != 443))) {
|
|
166
|
-
fullUrl += `:${portToUse}`
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
fullUrl += translatedRoute
|
|
170
|
-
|
|
171
|
-
return fullUrl
|
|
172
|
-
}
|
|
173
|
-
}
|