@kaspernj/api-maker 1.0.445 → 1.0.447
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/{.eslintrc.cjs → .eslintrc.js} +4 -0
- package/README.md +35 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/api_maker/ApiMakerModule.kt +50 -0
- package/android/src/main/java/expo/modules/api_maker/ApiMakerView.kt +30 -0
- package/build/api.js +120 -0
- package/build/attribute-not-loaded-error.js +2 -0
- package/build/base-component.js +5 -0
- package/build/base-error.js +33 -0
- package/build/base-model/attribute.js +25 -0
- package/build/base-model/column.js +11 -0
- package/build/base-model/reflection.js +14 -0
- package/build/base-model/scope.js +11 -0
- package/build/base-model.js +828 -0
- package/build/bootstrap/attribute-row/index.js +105 -0
- package/build/bootstrap/attribute-rows.js +31 -0
- package/build/bootstrap/card.js +138 -0
- package/build/bootstrap/checkbox.js +97 -0
- package/build/bootstrap/checkboxes.js +183 -0
- package/build/bootstrap/index.js +2 -0
- package/build/bootstrap/input.js +128 -0
- package/build/bootstrap/invalid-feedback.js +27 -0
- package/build/bootstrap/paginate.js +150 -0
- package/build/bootstrap/radio-buttons.js +72 -0
- package/build/bootstrap/select.js +88 -0
- package/build/bootstrap/sort-link.js +130 -0
- package/build/cable-connection-pool.js +128 -0
- package/build/cable-subscription-pool.js +207 -0
- package/build/cable-subscription.js +21 -0
- package/build/cache-key-generator.js +81 -0
- package/build/can-can.js +134 -0
- package/build/channels-consumer.js +3 -0
- package/build/collection-loader.js +48 -0
- package/build/collection.js +279 -0
- package/build/command-submit-data.js +81 -0
- package/build/commands-pool.js +195 -0
- package/build/compose.js +9 -0
- package/build/config.js +53 -0
- package/build/custom-error.js +5 -0
- package/build/data-set-to-attributes.js +10 -0
- package/build/deserializer.js +56 -0
- package/build/destroy-error.js +5 -0
- package/build/devise.js +109 -0
- package/build/draggable-sort/controller.js +136 -0
- package/build/draggable-sort/index.js +114 -0
- package/build/draggable-sort/item.js +188 -0
- package/build/error-logger.js +101 -0
- package/build/error-messages.js +13 -0
- package/build/event-connection.js +32 -0
- package/build/event-model-class.js +24 -0
- package/build/events.js +5 -0
- package/build/form.js +83 -0
- package/build/index.js +3 -0
- package/build/inputs/attachment.js +121 -0
- package/build/inputs/auto-submit.js +36 -0
- package/build/inputs/checkbox.js +145 -0
- package/build/inputs/checkboxes.js +111 -0
- package/build/inputs/id-for-component.js +15 -0
- package/build/inputs/input-wrapper.js +18 -0
- package/build/inputs/input.js +230 -0
- package/build/inputs/money.js +179 -0
- package/build/inputs/name-for-component.js +13 -0
- package/build/inputs/select.js +92 -0
- package/build/instance-of-class-name.js +23 -0
- package/build/key-value-store.js +53 -0
- package/build/link.js +68 -0
- package/build/logger.js +30 -0
- package/build/modal.js +37 -0
- package/build/model-class-require.js +13 -0
- package/build/model-events.js +30 -0
- package/build/model-name.js +28 -0
- package/build/model-prop-type.js +101 -0
- package/build/model-recipes-loader.js +32 -0
- package/build/model-recipes-model-loader.js +357 -0
- package/build/models-response-reader.js +40 -0
- package/build/models.js +8 -0
- package/build/money-formatter.js +77 -0
- package/build/not-loaded-error.js +2 -0
- package/build/params.js +60 -0
- package/build/preloaded.js +38 -0
- package/build/resize-observer.js +11 -0
- package/build/result.js +13 -0
- package/build/router/route.js +262 -0
- package/build/router/switch.js +72 -0
- package/build/router.js +57 -0
- package/build/routes-native.js +202 -0
- package/build/routes.js +50 -0
- package/build/run-last.js +35 -0
- package/build/serializer.js +63 -0
- package/build/services.js +20 -0
- package/build/session-status-updater.js +126 -0
- package/build/source-maps-loader.js +171 -0
- package/build/super-admin/config-reader.js +84 -0
- package/build/super-admin/edit-page/edit-attribute-checkbox.js +85 -0
- package/build/super-admin/edit-page/edit-attribute-content.js +54 -0
- package/build/super-admin/edit-page/edit-attribute-input.js +79 -0
- package/build/super-admin/edit-page/edit-attribute.js +76 -0
- package/build/super-admin/edit-page.js +120 -0
- package/build/super-admin/has-edit-config.js +12 -0
- package/build/super-admin/index-page.js +24 -0
- package/build/super-admin/index.js +180 -0
- package/build/super-admin/layout/header/index.js +151 -0
- package/build/super-admin/layout/index.js +109 -0
- package/build/super-admin/layout/menu/index.js +93 -0
- package/build/super-admin/layout/menu/menu-content.js +40 -0
- package/build/super-admin/layout/menu/menu-item.js +83 -0
- package/build/super-admin/layout/no-access.js +25 -0
- package/build/super-admin/model-class-table.js +61 -0
- package/build/super-admin/models.js +8 -0
- package/build/super-admin/show-nav.js +49 -0
- package/build/super-admin/show-page/belongs-to-attribute-row.js +28 -0
- package/build/super-admin/show-page/index.js +141 -0
- package/build/super-admin/show-reflection-actions.js +47 -0
- package/build/super-admin/show-reflection-link.js +46 -0
- package/build/super-admin/show-reflection-page.js +47 -0
- package/build/table/column-content.js +112 -0
- package/build/table/column-identifier.js +18 -0
- package/build/table/column-visible.js +7 -0
- package/build/table/components/column.js +20 -0
- package/build/table/components/flat-list.js +20 -0
- package/build/table/components/header.js +25 -0
- package/build/table/components/row.js +25 -0
- package/build/table/filters/attribute-element.js +43 -0
- package/build/table/filters/filter-form.js +392 -0
- package/build/table/filters/filter.js +89 -0
- package/build/table/filters/index.js +182 -0
- package/build/table/filters/load-search-modal.js +174 -0
- package/build/table/filters/reflection-element.js +36 -0
- package/build/table/filters/save-search-modal.js +86 -0
- package/build/table/filters/scope-element.js +41 -0
- package/build/table/header-column-content.js +67 -0
- package/build/table/header-column.js +144 -0
- package/build/table/header-select.js +104 -0
- package/build/table/model-callback-args.js +10 -0
- package/build/table/model-column.js +87 -0
- package/build/table/model-row.js +179 -0
- package/build/table/select-calculator.js +63 -0
- package/build/table/settings/column-row.js +97 -0
- package/build/table/settings/download-action.js +78 -0
- package/build/table/settings/index.js +92 -0
- package/build/table/table-settings.js +219 -0
- package/build/table/table.js +972 -0
- package/build/table/use-sorting.js +34 -0
- package/build/table/widths.js +75 -0
- package/build/table/worker-plugins-check-all-checkbox.js +125 -0
- package/build/table/worker-plugins-checkbox.js +115 -0
- package/build/translated-attributes.js +10 -0
- package/build/translated-collections.js +11 -0
- package/build/updated-attribute.js +76 -0
- package/build/url-encode.js +15 -0
- package/build/use-breakpoint.js +44 -0
- package/build/use-can-can.js +55 -0
- package/build/use-collection.js +225 -0
- package/build/use-created-event.js +52 -0
- package/build/use-current-user.js +73 -0
- package/build/use-destroyed-event.js +60 -0
- package/build/use-event-emitter.js +13 -0
- package/build/use-event-listener.js +16 -0
- package/build/use-input.js +140 -0
- package/build/use-model-event.js +60 -0
- package/build/use-model.js +169 -0
- package/build/use-resize-observer.js +23 -0
- package/build/use-router.js +102 -0
- package/build/use-screen-layout.js +39 -0
- package/build/use-updated-event.js +60 -0
- package/build/use-validation-errors.js +30 -0
- package/build/utils/card.js +51 -0
- package/build/utils/checkbox.js +48 -0
- package/build/utils/default-style.js +18 -0
- package/build/utils/modal.js +61 -0
- package/build/utils/text.js +18 -0
- package/build/validation-error.js +28 -0
- package/build/validation-errors.js +98 -0
- package/build/with-collection.js +13 -0
- package/build/with-current-user.js +9 -0
- package/build/with-model.js +14 -0
- package/build/with-router.js +21 -0
- package/expo-module.config.json +17 -0
- package/ios/ApiMaker.podspec +29 -0
- package/ios/ApiMakerModule.swift +48 -0
- package/ios/ApiMakerView.swift +38 -0
- package/package.json +35 -14
- package/src/{api.mjs → api.js} +5 -5
- package/src/{base-error.mjs → base-error.js} +1 -1
- package/src/base-model/{attribute.mjs → attribute.js} +1 -1
- package/src/base-model/{reflection.mjs → reflection.js} +1 -1
- package/src/{base-model.mjs → base-model.js} +14 -14
- package/src/bootstrap/attribute-row/index.jsx +2 -2
- package/src/bootstrap/attribute-rows.jsx +1 -1
- package/src/bootstrap/card.jsx +1 -1
- package/src/bootstrap/checkbox.jsx +1 -1
- package/src/bootstrap/checkboxes.jsx +1 -1
- package/src/bootstrap/input.jsx +1 -1
- package/src/bootstrap/paginate.jsx +2 -2
- package/src/bootstrap/sort-link.jsx +3 -3
- package/src/{cable-connection-pool.mjs → cable-connection-pool.js} +3 -3
- package/src/{cable-subscription-pool.mjs → cable-subscription-pool.js} +4 -4
- package/src/{cable-subscription.mjs → cable-subscription.js} +1 -1
- package/src/{can-can.mjs → can-can.js} +1 -1
- package/src/collection-loader.jsx +2 -2
- package/src/{collection.mjs → collection.js} +3 -3
- package/src/{commands-pool.mjs → commands-pool.js} +11 -11
- package/src/{custom-error.mjs → custom-error.js} +1 -1
- package/src/{deserializer.mjs → deserializer.js} +2 -2
- package/src/{destroy-error.mjs → destroy-error.js} +1 -1
- package/src/{devise.mjs → devise.js} +5 -9
- package/src/draggable-sort/controller.js +137 -0
- package/src/draggable-sort/index.jsx +108 -0
- package/src/draggable-sort/item.jsx +174 -0
- package/src/{error-logger.mjs → error-logger.js} +1 -1
- package/src/event-connection.jsx +1 -1
- package/src/event-model-class.jsx +1 -1
- package/src/form.jsx +1 -1
- package/src/index.js +3 -0
- package/src/inputs/attachment.jsx +2 -2
- package/src/inputs/checkbox.jsx +7 -6
- package/src/inputs/checkboxes.jsx +1 -1
- package/src/inputs/input-wrapper.jsx +1 -1
- package/src/inputs/input.jsx +8 -7
- package/src/inputs/money.jsx +3 -3
- package/src/inputs/select.jsx +1 -1
- package/src/{key-value-store.mjs → key-value-store.js} +1 -1
- package/src/link.jsx +2 -2
- package/src/modal.jsx +1 -1
- package/src/{model-class-require.mjs → model-class-require.js} +4 -2
- package/src/{model-events.mjs → model-events.js} +1 -1
- package/src/{model-name.mjs → model-name.js} +1 -1
- package/src/{model-recipes-loader.mjs → model-recipes-loader.js} +1 -1
- package/src/{model-recipes-model-loader.mjs → model-recipes-model-loader.js} +2 -2
- package/src/{models-response-reader.mjs → models-response-reader.js} +2 -2
- package/src/models.js +7 -0
- package/src/{models.mjs.erb → models.js.erb} +1 -1
- package/src/{params.mjs → params.js} +2 -2
- package/src/{preloaded.mjs → preloaded.js} +1 -1
- package/src/resize-observer.jsx +1 -1
- package/src/router/route.jsx +1 -1
- package/src/router/switch.jsx +1 -1
- package/src/router.jsx +1 -1
- package/src/{routes-native.mjs → routes-native.js} +1 -1
- package/src/{services.mjs → services.js} +1 -1
- package/src/{session-status-updater.mjs → session-status-updater.js} +3 -3
- package/src/{source-maps-loader.mjs → source-maps-loader.js} +1 -1
- package/src/super-admin/edit-page/edit-attribute-checkbox.jsx +1 -1
- package/src/super-admin/edit-page/edit-attribute-content.jsx +1 -1
- package/src/super-admin/edit-page/edit-attribute-input.jsx +1 -1
- package/src/super-admin/edit-page/edit-attribute.jsx +1 -1
- package/src/super-admin/edit-page.jsx +2 -2
- package/src/super-admin/has-edit-config.js +1 -1
- package/src/super-admin/index-page.jsx +1 -1
- package/src/super-admin/index.jsx +7 -7
- package/src/super-admin/layout/header/index.jsx +2 -2
- package/src/super-admin/layout/index.jsx +3 -3
- package/src/super-admin/layout/menu/index.jsx +3 -3
- package/src/super-admin/layout/menu/menu-content.jsx +2 -2
- package/src/super-admin/layout/menu/{menu-item/index.jsx → menu-item.jsx} +5 -6
- package/src/super-admin/layout/no-access.jsx +2 -2
- package/src/super-admin/model-class-table.jsx +3 -3
- package/src/super-admin/models.js +1 -1
- package/src/super-admin/show-nav.jsx +2 -2
- package/src/super-admin/show-page/belongs-to-attribute-row.jsx +1 -1
- package/src/super-admin/show-page/index.jsx +2 -2
- package/src/super-admin/show-reflection-actions.jsx +1 -1
- package/src/super-admin/show-reflection-link.jsx +1 -1
- package/src/super-admin/show-reflection-page.jsx +1 -1
- package/src/table/column-content.jsx +1 -1
- package/src/table/components/column.jsx +8 -2
- package/src/table/components/header.jsx +2 -2
- package/src/table/filters/filter-form.jsx +1 -1
- package/src/table/filters/index.jsx +5 -3
- package/src/table/filters/load-search-modal.jsx +6 -4
- package/src/table/filters/save-search-modal.jsx +4 -4
- package/src/table/header-column.jsx +59 -79
- package/src/table/header-select.jsx +1 -1
- package/src/table/model-column.jsx +12 -6
- package/src/table/model-row.jsx +11 -7
- package/src/table/{select-calculator.mjs → select-calculator.js} +1 -1
- package/src/table/settings/column-row.jsx +4 -3
- package/src/table/settings/download-action.jsx +3 -3
- package/src/table/settings/index.jsx +3 -3
- package/src/table/table-settings.js +5 -4
- package/src/table/table.jsx +149 -71
- package/src/table/{use-sorting.mjs → use-sorting.js} +1 -1
- package/src/table/{widths.mjs → widths.jsx} +11 -2
- package/src/table/worker-plugins-check-all-checkbox.jsx +2 -2
- package/src/table/worker-plugins-checkbox.jsx +2 -2
- package/src/{translated-collections.mjs → translated-collections.js} +1 -1
- package/src/updated-attribute.jsx +1 -1
- package/src/{use-breakpoint.mjs → use-breakpoint.js} +2 -2
- package/src/use-can-can.js +55 -0
- package/src/{use-collection.mjs → use-collection.js} +4 -4
- package/src/{use-created-event.mjs → use-created-event.js} +2 -2
- package/src/{use-current-user.mjs → use-current-user.js} +6 -5
- package/src/{use-destroyed-event.mjs → use-destroyed-event.js} +2 -2
- package/src/{use-input.mjs → use-input.js} +5 -5
- package/src/use-model-event.js +2 -2
- package/src/{use-model.mjs → use-model.js} +4 -4
- package/src/{use-resize-observer.mjs → use-resize-observer.js} +1 -1
- package/src/use-router.jsx +2 -2
- package/src/{use-updated-event.mjs → use-updated-event.js} +2 -2
- package/src/{use-validation-errors.mjs → use-validation-errors.js} +3 -3
- package/src/utils/checkbox.jsx +2 -2
- package/src/{validation-error.mjs → validation-error.js} +1 -1
- package/src/{validation-errors.mjs → validation-errors.js} +1 -1
- package/src/with-current-user.jsx +1 -1
- package/src/with-model.jsx +1 -1
- package/__tests__/base-model.test.mjs +0 -71
- package/__tests__/cable-connection-pool.test.mjs +0 -227
- package/__tests__/cable-subscription-pool.test.mjs +0 -27
- package/__tests__/can-can.test.mjs +0 -34
- package/__tests__/collection.test.mjs +0 -51
- package/__tests__/custom-error.test.mjs +0 -13
- package/__tests__/model-name.test.mjs +0 -34
- package/__tests__/model-prop-type.test.mjs +0 -113
- package/__tests__/params.test.mjs +0 -40
- package/__tests__/routes-native.test.mjs +0 -104
- package/__tests__/routes.test.mjs +0 -47
- package/__tests__/serializer.test.mjs +0 -30
- package/__tests__/support/task.mjs +0 -27
- package/__tests__/support/user.mjs +0 -32
- package/index.js +0 -1
- package/jest.config.js +0 -9
- package/src/event-created.jsx +0 -12
- package/src/event-destroyed.jsx +0 -25
- package/src/event-emitter-listener.jsx +0 -10
- package/src/event-listener.jsx +0 -25
- package/src/event-updated.jsx +0 -27
- package/src/super-admin/layout/menu/menu-item/style.scss +0 -10
- package/src/use-can-can.mjs +0 -48
- package/src/with-can-can.jsx +0 -12
- package/webpack.config.js +0 -15
- /package/src/{attribute-not-loaded-error.mjs → attribute-not-loaded-error.js} +0 -0
- /package/src/base-model/{column.mjs → column.js} +0 -0
- /package/src/base-model/{scope.mjs → scope.js} +0 -0
- /package/src/{cache-key-generator.mjs → cache-key-generator.js} +0 -0
- /package/src/{channels-consumer.mjs → channels-consumer.js} +0 -0
- /package/src/{command-submit-data.mjs → command-submit-data.js} +0 -0
- /package/src/{config.mjs → config.js} +0 -0
- /package/src/{data-set-to-attributes.mjs → data-set-to-attributes.js} +0 -0
- /package/src/{error-messages.mjs → error-messages.js} +0 -0
- /package/src/{events.mjs → events.js} +0 -0
- /package/src/inputs/{auto-submit.mjs → auto-submit.js} +0 -0
- /package/src/inputs/{id-for-component.mjs → id-for-component.js} +0 -0
- /package/src/inputs/{name-for-component.mjs → name-for-component.js} +0 -0
- /package/src/{instance-of-class-name.mjs → instance-of-class-name.js} +0 -0
- /package/src/{logger.mjs → logger.js} +0 -0
- /package/src/{model-prop-type.mjs → model-prop-type.js} +0 -0
- /package/src/{money-formatter.mjs → money-formatter.js} +0 -0
- /package/src/{not-loaded-error.mjs → not-loaded-error.js} +0 -0
- /package/src/{result.mjs → result.js} +0 -0
- /package/src/{routes.mjs → routes.js} +0 -0
- /package/src/{run-last.mjs → run-last.js} +0 -0
- /package/src/{serializer.mjs → serializer.js} +0 -0
- /package/src/table/{column-identifier.mjs → column-identifier.js} +0 -0
- /package/src/table/{column-visible.mjs → column-visible.js} +0 -0
- /package/src/table/{model-callback-args.mjs → model-callback-args.js} +0 -0
- /package/src/{translated-collections-data.mjs.erb → translated-collections-data.js.erb} +0 -0
- /package/src/{url-encode.mjs → url-encode.js} +0 -0
- /package/src/{use-event-emitter.mjs → use-event-emitter.js} +0 -0
- /package/src/{use-event-listener.mjs → use-event-listener.js} +0 -0
- /package/src/{use-screen-layout.mjs → use-screen-layout.js} +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {useMemo} from "react"
|
|
2
|
+
import {Animated, PanResponder} from "react-native"
|
|
3
|
+
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component"
|
|
4
|
+
import Controller from "./controller"
|
|
5
|
+
import DraggableSortItem from "./item"
|
|
6
|
+
import EventEmitter from "events"
|
|
7
|
+
import memo from "set-state-compare/src/memo"
|
|
8
|
+
import PropTypes from "prop-types"
|
|
9
|
+
import propTypesExact from "prop-types-exact"
|
|
10
|
+
import useEventEmitter from "../use-event-emitter"
|
|
11
|
+
|
|
12
|
+
export default memo(shapeComponent(class DraggableSort extends ShapeComponent {
|
|
13
|
+
static defaultProps = {
|
|
14
|
+
horizontal: false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static propTypes = propTypesExact({
|
|
18
|
+
cacheKeyExtractor: PropTypes.func,
|
|
19
|
+
data: PropTypes.array.isRequired,
|
|
20
|
+
dataSet: PropTypes.object,
|
|
21
|
+
events: PropTypes.instanceOf(EventEmitter),
|
|
22
|
+
horizontal: PropTypes.bool.isRequired,
|
|
23
|
+
keyExtractor: PropTypes.func.isRequired,
|
|
24
|
+
onDragItemEnd: PropTypes.func,
|
|
25
|
+
onDragItemStart: PropTypes.func,
|
|
26
|
+
onItemMoved: PropTypes.func,
|
|
27
|
+
onReordered: PropTypes.func.isRequired,
|
|
28
|
+
renderItem: PropTypes.func.isRequired
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
setup() {
|
|
32
|
+
const {data, keyExtractor} = this.p
|
|
33
|
+
const {events} = this.props
|
|
34
|
+
|
|
35
|
+
this.controller = useMemo(() => new Controller({data, events, keyExtractor}), [])
|
|
36
|
+
this.panResponder = useMemo(
|
|
37
|
+
() => PanResponder.create({
|
|
38
|
+
onStartShouldSetPanResponder: (e) => {
|
|
39
|
+
const initialDragPosition = {x: e.nativeEvent.locationX, y: e.nativeEvent.locationY}
|
|
40
|
+
|
|
41
|
+
this.controller.setInitialDragPosition(initialDragPosition)
|
|
42
|
+
|
|
43
|
+
if (this.controller.draggedItemData) {
|
|
44
|
+
return true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
onPanResponderMove: (e, gestate) => {
|
|
48
|
+
this.tt.controller.onMove({gestate})
|
|
49
|
+
},
|
|
50
|
+
onPanResponderRelease: (e, gestate) => {
|
|
51
|
+
if (this.controller.draggedItem) {
|
|
52
|
+
this.tt.controller.onDragEnd()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
[]
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
useEventEmitter(this.controller.getEvents(), "onDragStart", this.tt.onDragItemStart)
|
|
60
|
+
useEventEmitter(this.controller.getEvents(), "onDragEnd", this.tt.onDragItemEnd)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
render() {
|
|
64
|
+
const {data, horizontal, keyExtractor, renderItem} = this.p
|
|
65
|
+
const {cacheKeyExtractor, dataSet} = this.props
|
|
66
|
+
const actualDataSet = useMemo(
|
|
67
|
+
() => Object.assign(
|
|
68
|
+
{
|
|
69
|
+
component: "draggable-sort"
|
|
70
|
+
},
|
|
71
|
+
dataSet
|
|
72
|
+
),
|
|
73
|
+
[dataSet]
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Animated.View dataSet={actualDataSet} style={{flexDirection: horizontal ? "row" : "column"}} {...this.tt.panResponder.panHandlers}>
|
|
78
|
+
{data.map((item, itemIndex) =>
|
|
79
|
+
<DraggableSortItem
|
|
80
|
+
cacheKey={cacheKeyExtractor ? cacheKeyExtractor(item) : undefined}
|
|
81
|
+
controller={this.tt.controller}
|
|
82
|
+
item={item}
|
|
83
|
+
itemIndex={itemIndex}
|
|
84
|
+
key={keyExtractor(item)}
|
|
85
|
+
onItemMoved={this.props.onItemMoved}
|
|
86
|
+
renderItem={renderItem}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
</Animated.View>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
onDragItemStart = ({itemData}) => {
|
|
94
|
+
if (this.props.onDragItemStart) {
|
|
95
|
+
this.p.onDragItemStart({itemData})
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
onDragItemEnd = (args) => {
|
|
100
|
+
if (args.toPosition !== null) {
|
|
101
|
+
this.p.onReordered(args)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (this.props.onDragItemEnd) {
|
|
105
|
+
this.p.onDragItemEnd(args)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}))
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {useMemo} from "react"
|
|
2
|
+
import {Animated, Easing, PanResponder} from "react-native"
|
|
3
|
+
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component"
|
|
4
|
+
import EventEmitter from "events"
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
6
|
+
import PropTypes from "prop-types"
|
|
7
|
+
import propTypesExact from "prop-types-exact"
|
|
8
|
+
import useEventEmitter from "../use-event-emitter"
|
|
9
|
+
|
|
10
|
+
export default memo(shapeComponent(class DraggableSortItem extends ShapeComponent {
|
|
11
|
+
static propTypes = propTypesExact({
|
|
12
|
+
cacheKey: PropTypes.string,
|
|
13
|
+
controller: PropTypes.object.isRequired,
|
|
14
|
+
item: PropTypes.any.isRequired,
|
|
15
|
+
itemIndex: PropTypes.number.isRequired,
|
|
16
|
+
onItemMoved: PropTypes.func,
|
|
17
|
+
renderItem: PropTypes.func.isRequired
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
initialLayout = null
|
|
21
|
+
|
|
22
|
+
setup() {
|
|
23
|
+
this.useStates({
|
|
24
|
+
active: false,
|
|
25
|
+
dragging: false
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
this.events = useMemo(() => new EventEmitter(), [])
|
|
29
|
+
this.position = useMemo(() => new Animated.ValueXY(), [])
|
|
30
|
+
this.panResponder = useMemo(
|
|
31
|
+
() => PanResponder.create({
|
|
32
|
+
onStartShouldSetPanResponder: (e, ) => {
|
|
33
|
+
this.setState({dragging: true})
|
|
34
|
+
this.p.controller.onDragStart({item: this.p.item, itemIndex: this.p.itemIndex})
|
|
35
|
+
|
|
36
|
+
return false
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
[]
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
useEventEmitter(this.p.controller.getEvents(), "onDragStart", this.tt.onDragStart)
|
|
43
|
+
useEventEmitter(this.p.controller.getEvents(), "onDragEndAnimation", this.tt.onDragEndAnimation)
|
|
44
|
+
useEventEmitter(this.tt.events, "move", this.tt.onMove)
|
|
45
|
+
useEventEmitter(this.tt.events, "moveToPosition", this.tt.onMoveToPosition)
|
|
46
|
+
useEventEmitter(this.tt.events, "resetPosition", this.tt.onResetPosition)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
render() {
|
|
50
|
+
const {item, renderItem} = this.p
|
|
51
|
+
const {active} = this.s
|
|
52
|
+
const style = useMemo(
|
|
53
|
+
() => {
|
|
54
|
+
const style = {
|
|
55
|
+
transform: this.tt.position.getTranslateTransform()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (active) {
|
|
59
|
+
style.backgroundColor = "#fff"
|
|
60
|
+
style.elevation = 2
|
|
61
|
+
style.zIndex = 99999
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return style
|
|
65
|
+
},
|
|
66
|
+
[active]
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Animated.View dataSet={{component: "draggable-sort/item"}} onLayout={this.tt.onLayout} style={style}>
|
|
71
|
+
{renderItem({isActive: active, item, touchProps: this.tt.panResponder.panHandlers})}
|
|
72
|
+
</Animated.View>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
onDragStart = ({itemData}) => {
|
|
77
|
+
const newState = {dragging: true}
|
|
78
|
+
|
|
79
|
+
if (itemData.index == this.p.itemIndex) {
|
|
80
|
+
newState.active = true
|
|
81
|
+
this.baseXAtStartedDragging = this.getBaseX()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.setState(newState)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
onDragEndAnimation = () => this.setState({active: false, dragging: false})
|
|
88
|
+
|
|
89
|
+
onLayout = (e) => {
|
|
90
|
+
const {controller, item, itemIndex} = this.p
|
|
91
|
+
|
|
92
|
+
controller.onItemLayout({events: this.tt.events, index: itemIndex, item, layout: e.nativeEvent.layout})
|
|
93
|
+
|
|
94
|
+
if (!this.tt.initialLayout) {
|
|
95
|
+
this.initialLayout = e.nativeEvent.layout
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
onMove = ({gestate}) => {
|
|
100
|
+
const x = gestate.dx + this.tt.baseXAtStartedDragging - this.tt.initialLayout.x
|
|
101
|
+
const y = this.tt.initialLayout.y
|
|
102
|
+
|
|
103
|
+
this.tt.position.setValue({x, y})
|
|
104
|
+
|
|
105
|
+
if (this.props.onItemMoved) {
|
|
106
|
+
this.p.onItemMoved({itemIndex: this.p.itemIndex, x, y})
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
onMoveToPosition = ({x, y}) => {
|
|
111
|
+
const calculatedXFromStartingPosition = x - this.tt.initialLayout.x
|
|
112
|
+
const animationArgs = {
|
|
113
|
+
duration: 200,
|
|
114
|
+
easing: Easing.inOut(Easing.linear),
|
|
115
|
+
toValue: {
|
|
116
|
+
x: calculatedXFromStartingPosition,
|
|
117
|
+
y
|
|
118
|
+
},
|
|
119
|
+
useNativeDriver: true,
|
|
120
|
+
}
|
|
121
|
+
const animationEventArgs = {animationArgs, animationType: "moveToPosition", item: this.p.item}
|
|
122
|
+
|
|
123
|
+
this.p.controller.events.emit("onAnimationStart", animationEventArgs)
|
|
124
|
+
|
|
125
|
+
Animated
|
|
126
|
+
.timing(this.tt.position, animationArgs)
|
|
127
|
+
.start(() => {
|
|
128
|
+
this.p.controller.events.emit("onAnimationEnd", animationEventArgs)
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
if (this.props.onItemMoved) {
|
|
132
|
+
this.p.onItemMoved({
|
|
133
|
+
animationArgs,
|
|
134
|
+
itemIndex: this.p.itemIndex,
|
|
135
|
+
x: calculatedXFromStartingPosition,
|
|
136
|
+
y
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
getBaseX = () => this.p.controller.getItemDataForIndex(this.p.itemIndex).baseX
|
|
142
|
+
|
|
143
|
+
onResetPosition = (args) => {
|
|
144
|
+
const baseX = this.getBaseX() - this.tt.initialLayout.x
|
|
145
|
+
const animationArgs = {
|
|
146
|
+
duration: 200,
|
|
147
|
+
easing: Easing.inOut(Easing.linear),
|
|
148
|
+
toValue: {
|
|
149
|
+
x: baseX,
|
|
150
|
+
y: 0
|
|
151
|
+
},
|
|
152
|
+
useNativeDriver: true,
|
|
153
|
+
}
|
|
154
|
+
const animationEventArgs = {animationArgs, animationType: "resetPosition", item: this.p.item}
|
|
155
|
+
|
|
156
|
+
this.p.controller.events.emit("onAnimationStart", animationEventArgs)
|
|
157
|
+
|
|
158
|
+
Animated
|
|
159
|
+
.timing(this.tt.position, animationArgs)
|
|
160
|
+
.start(() => {
|
|
161
|
+
this.p.controller.events.emit("onAnimationEnd", animationEventArgs)
|
|
162
|
+
if (args?.callback) args.callback()
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
if (this.props.onItemMoved) {
|
|
166
|
+
this.p.onItemMoved({
|
|
167
|
+
animationArgs,
|
|
168
|
+
itemIndex: this.p.itemIndex,
|
|
169
|
+
x: baseX,
|
|
170
|
+
y: 0
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}))
|
package/src/event-connection.jsx
CHANGED
package/src/form.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import FormDataObjectizer from "form-data-objectizer"
|
|
|
4
4
|
import memo from "set-state-compare/src/memo"
|
|
5
5
|
import {Platform} from "react-native"
|
|
6
6
|
import PropTypes from "prop-types"
|
|
7
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
7
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
8
8
|
|
|
9
9
|
const FormContext = createContext(null)
|
|
10
10
|
|
package/src/index.js
ADDED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
|
-
import {Input as ApiMakerInput} from "@kaspernj/api-maker/
|
|
2
|
+
import {Input as ApiMakerInput} from "@kaspernj/api-maker/build/inputs/input"
|
|
3
3
|
import Checkbox from "./checkbox"
|
|
4
4
|
import memo from "set-state-compare/src/memo"
|
|
5
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
5
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
6
6
|
|
|
7
7
|
export default memo(shapeComponent(class ApiMakerInputsAttachment extends BaseComponent {
|
|
8
8
|
static propTypes = {
|
package/src/inputs/checkbox.jsx
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import AutoSubmit from "./auto-submit
|
|
1
|
+
import AutoSubmit from "./auto-submit"
|
|
2
2
|
import BaseComponent from "../base-component"
|
|
3
3
|
import {digg} from "diggerize"
|
|
4
|
-
import EventUpdated from "../event-updated"
|
|
5
4
|
import PropTypes from "prop-types"
|
|
6
5
|
import memo from "set-state-compare/src/memo"
|
|
7
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
6
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
8
7
|
import useInput from "../use-input"
|
|
9
8
|
import {useForm} from "../form"
|
|
10
9
|
import {useMemo} from "react"
|
|
10
|
+
import useUpdatedEvent from "../use-updated-event"
|
|
11
11
|
|
|
12
12
|
export default memo(shapeComponent(class ApiMakerInputsCheckbox extends BaseComponent {
|
|
13
13
|
static defaultProps = {
|
|
14
14
|
autoRefresh: false,
|
|
15
15
|
autoSubmit: false,
|
|
16
16
|
defaultValue: 1,
|
|
17
|
+
model: null,
|
|
17
18
|
zeroInput: true
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -33,6 +34,7 @@ export default memo(shapeComponent(class ApiMakerInputsCheckbox extends BaseComp
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
setup() {
|
|
37
|
+
const {autoRefresh, model} = this.p
|
|
36
38
|
const {inputProps, restProps: useInputRestProps} = useInput({props: this.props, wrapperOptions: {type: "checkbox"}})
|
|
37
39
|
const {defaultValue, name} = inputProps
|
|
38
40
|
|
|
@@ -47,6 +49,8 @@ export default memo(shapeComponent(class ApiMakerInputsCheckbox extends BaseComp
|
|
|
47
49
|
this.tt.form?.setValue(name, defaultValue)
|
|
48
50
|
}
|
|
49
51
|
}, [])
|
|
52
|
+
|
|
53
|
+
useUpdatedEvent(model, this.tt.onModelUpdated, {active: Boolean(autoRefresh && model)})
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
render () {
|
|
@@ -69,9 +73,6 @@ export default memo(shapeComponent(class ApiMakerInputsCheckbox extends BaseComp
|
|
|
69
73
|
|
|
70
74
|
return (
|
|
71
75
|
<>
|
|
72
|
-
{autoRefresh && model &&
|
|
73
|
-
<EventUpdated model={model} onUpdated={this.tt.onModelUpdated} />
|
|
74
|
-
}
|
|
75
76
|
{zeroInput && inputProps.name &&
|
|
76
77
|
<input defaultValue="0" name={inputProps.name} type="hidden" />
|
|
77
78
|
}
|
|
@@ -7,7 +7,7 @@ import InvalidFeedback from "../bootstrap/invalid-feedback"
|
|
|
7
7
|
import PropTypes from "prop-types"
|
|
8
8
|
import propTypesExact from "prop-types-exact"
|
|
9
9
|
import memo from "set-state-compare/src/memo"
|
|
10
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
10
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
11
11
|
|
|
12
12
|
const ApiMakerInputsCheckboxes = memo(shapeComponent(class ApiMakerInputsCheckboxes extends BaseComponent {
|
|
13
13
|
static propTypes = propTypesExact({
|
package/src/inputs/input.jsx
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import AutoSubmit from "./auto-submit
|
|
1
|
+
import AutoSubmit from "./auto-submit"
|
|
2
2
|
import BaseComponent from "../base-component"
|
|
3
3
|
import {dig, digg, digs} from "diggerize"
|
|
4
|
-
import EventUpdated from "../event-updated"
|
|
5
4
|
import inputWrapper from "./input-wrapper"
|
|
6
5
|
import memo from "set-state-compare/src/memo"
|
|
7
6
|
import Money from "./money"
|
|
8
7
|
import PropTypes from "prop-types"
|
|
9
8
|
import {useMemo, useRef} from "react"
|
|
10
9
|
import replaceall from "replaceall"
|
|
11
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
10
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
12
11
|
import strftime from "strftime"
|
|
13
12
|
import {useForm} from "../form"
|
|
13
|
+
import useUpdatedEvent from "../use-updated-event"
|
|
14
14
|
|
|
15
15
|
const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extends BaseComponent {
|
|
16
16
|
static defaultProps = {
|
|
17
17
|
autoRefresh: false,
|
|
18
18
|
autoSubmit: false,
|
|
19
|
+
model: null,
|
|
19
20
|
localizedNumber: false
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -35,7 +36,7 @@ const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extend
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
setup() {
|
|
38
|
-
const {inputProps} = this.p
|
|
39
|
+
const {autoRefresh, inputProps, model} = this.p
|
|
39
40
|
const {defaultValue, name} = inputProps
|
|
40
41
|
|
|
41
42
|
this.form = useForm()
|
|
@@ -44,11 +45,14 @@ const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extend
|
|
|
44
45
|
this.useStates({
|
|
45
46
|
blankInputName: digg(inputProps, "type") == "file"
|
|
46
47
|
})
|
|
48
|
+
|
|
47
49
|
useMemo(() => {
|
|
48
50
|
if (name) {
|
|
49
51
|
this.tt.form?.setValue(name, defaultValue)
|
|
50
52
|
}
|
|
51
53
|
}, [])
|
|
54
|
+
|
|
55
|
+
useUpdatedEvent(model, this.tt.onModelUpdated, {active: Boolean(autoRefresh && model)})
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
render () {
|
|
@@ -81,9 +85,6 @@ const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extend
|
|
|
81
85
|
|
|
82
86
|
return (
|
|
83
87
|
<>
|
|
84
|
-
{autoRefresh && model &&
|
|
85
|
-
<EventUpdated model={model} onUpdated={this.onModelUpdated} />
|
|
86
|
-
}
|
|
87
88
|
{localizedNumber &&
|
|
88
89
|
<input
|
|
89
90
|
defaultValue={defaultValue}
|
package/src/inputs/money.jsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import classNames from "classnames"
|
|
2
|
-
import Config from "../config
|
|
2
|
+
import Config from "../config"
|
|
3
3
|
import {digg} from "diggerize"
|
|
4
|
-
import idForComponent from "./id-for-component
|
|
4
|
+
import idForComponent from "./id-for-component"
|
|
5
5
|
import * as inflection from "inflection"
|
|
6
6
|
import memo from "set-state-compare/src/memo"
|
|
7
7
|
import MoneyFormatter from "../money-formatter"
|
|
8
8
|
import PropTypes from "prop-types"
|
|
9
9
|
import PropTypesExact from "prop-types-exact"
|
|
10
10
|
import {useRef} from "react"
|
|
11
|
-
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component
|
|
11
|
+
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component"
|
|
12
12
|
|
|
13
13
|
export default memo(shapeComponent(class ApiMakerInputsMoney extends ShapeComponent {
|
|
14
14
|
static defaultProps = {
|
package/src/inputs/select.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import BaseComponent from "../base-component"
|
|
|
2
2
|
import inputWrapper from "./input-wrapper"
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
4
|
import memo from "set-state-compare/src/memo"
|
|
5
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
5
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
6
6
|
import {useForm} from "../form"
|
|
7
7
|
|
|
8
8
|
const ApiMakerInputsSelect = memo(shapeComponent(class ApiMakerInputsSelect extends BaseComponent {
|
package/src/link.jsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {Platform, Pressable} from "react-native"
|
|
2
2
|
import BaseComponent from "./base-component"
|
|
3
|
-
import dataSetToAttributes from "./data-set-to-attributes
|
|
3
|
+
import dataSetToAttributes from "./data-set-to-attributes"
|
|
4
4
|
import memo from "set-state-compare/src/memo"
|
|
5
5
|
import PropTypes from "prop-types"
|
|
6
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
6
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
7
7
|
|
|
8
8
|
export default memo(shapeComponent(class ApiMakerLink extends BaseComponent {
|
|
9
9
|
static propTypes = {
|
package/src/modal.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseComponent from "./base-component"
|
|
2
2
|
import memo from "set-state-compare/src/memo"
|
|
3
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
3
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
4
4
|
import {Modal, Pressable, View} from "react-native"
|
|
5
5
|
|
|
6
6
|
export default memo(shapeComponent(class ApiMakerModal extends BaseComponent {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as inflection from "inflection"
|
|
2
|
-
import
|
|
2
|
+
import models from "./models"
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const modelClassRequire = (modelName) => {
|
|
5
5
|
const requireName = inflection.camelize(modelName)
|
|
6
6
|
const ModelClass = models[requireName]
|
|
7
7
|
|
|
@@ -13,3 +13,5 @@ export default (modelName) => {
|
|
|
13
13
|
|
|
14
14
|
return ModelClass
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
export default modelClassRequire
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as inflection from "inflection"
|
|
2
|
-
import modelClassRequire from "./model-class-require
|
|
3
|
-
import Preloaded from "./preloaded
|
|
2
|
+
import modelClassRequire from "./model-class-require"
|
|
3
|
+
import Preloaded from "./preloaded"
|
|
4
4
|
|
|
5
5
|
export default class ModelsResponseReader {
|
|
6
6
|
static first (response) {
|
package/src/models.js
ADDED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* rails-erb-loader-dependencies api_maker/resources/ models/ */
|
|
2
2
|
|
|
3
3
|
import {digg} from "diggerize"
|
|
4
|
-
import ModelRecipesLoader from "./model-recipes-loader
|
|
4
|
+
import ModelRecipesLoader from "./model-recipes-loader"
|
|
5
5
|
|
|
6
6
|
const modelRecipes = <%= ApiMaker::ModelClassesJavaScriptGeneratorService.execute!.to_json %>
|
|
7
7
|
const loader = new ModelRecipesLoader({recipes: modelRecipes})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import config from "./config
|
|
1
|
+
import config from "./config"
|
|
2
2
|
import formSerialize from "form-serialize"
|
|
3
3
|
import Incorporator from "incorporator"
|
|
4
4
|
import qs from "qs"
|
|
5
|
-
import urlEncode from "./url-encode
|
|
5
|
+
import urlEncode from "./url-encode"
|
|
6
6
|
|
|
7
7
|
export default class Params {
|
|
8
8
|
static parse() {
|
package/src/resize-observer.jsx
CHANGED
package/src/router/route.jsx
CHANGED
|
@@ -3,7 +3,7 @@ import {createContext, useContext, useMemo} from "react"
|
|
|
3
3
|
import memo from "set-state-compare/src/memo"
|
|
4
4
|
import PropTypes from "prop-types"
|
|
5
5
|
import propTypesExact from "prop-types-exact"
|
|
6
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
6
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
7
7
|
import Switch, {CurrentSwitchContext} from "./switch"
|
|
8
8
|
|
|
9
9
|
const CurrentPathContext = createContext([])
|
package/src/router/switch.jsx
CHANGED
|
@@ -3,7 +3,7 @@ import {createContext} from "react"
|
|
|
3
3
|
import memo from "set-state-compare/src/memo"
|
|
4
4
|
import PropTypes from "prop-types"
|
|
5
5
|
import propTypesExact from "prop-types-exact"
|
|
6
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
6
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
7
7
|
|
|
8
8
|
const CurrentSwitchContext = createContext([])
|
|
9
9
|
|
package/src/router.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import BaseComponent from "./base-component"
|
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import propTypesExact from "prop-types-exact"
|
|
4
4
|
import React, {memo} from "react"
|
|
5
|
-
import {shapeComponent} from "set-state-compare/src/shape-component
|
|
5
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
6
6
|
import {Suspense} from "react"
|
|
7
7
|
import useRouter from "./use-router"
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {dig, digg, digs} from "diggerize"
|
|
2
2
|
import * as inflection from "inflection"
|
|
3
3
|
import qs from "qs"
|
|
4
|
-
import urlEncode from "./url-encode
|
|
4
|
+
import urlEncode from "./url-encode"
|
|
5
5
|
|
|
6
6
|
export default class ApiMakerRoutesNative {
|
|
7
7
|
constructor ({getLocale}) {
|