amis-core 2.6.0 → 2.7.0
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/package.json +2 -2
- package/esm/Root.d.ts +0 -46
- package/esm/Root.js +0 -89
- package/esm/RootRenderer.d.ts +0 -27
- package/esm/RootRenderer.js +0 -279
- package/esm/SchemaRenderer.d.ts +0 -37
- package/esm/SchemaRenderer.js +0 -332
- package/esm/Scoped.d.ts +0 -38
- package/esm/Scoped.js +0 -262
- package/esm/WithRootStore.d.ts +0 -719
- package/esm/WithRootStore.js +0 -34
- package/esm/WithStore.d.ts +0 -5
- package/esm/WithStore.js +0 -181
- package/esm/actions/Action.d.ts +0 -40
- package/esm/actions/Action.js +0 -186
- package/esm/actions/AjaxAction.d.ts +0 -27
- package/esm/actions/AjaxAction.js +0 -96
- package/esm/actions/BreakAction.d.ts +0 -15
- package/esm/actions/BreakAction.js +0 -31
- package/esm/actions/BroadcastAction.d.ts +0 -19
- package/esm/actions/BroadcastAction.js +0 -46
- package/esm/actions/CmptAction.d.ts +0 -21
- package/esm/actions/CmptAction.js +0 -66
- package/esm/actions/ContinueAction.d.ts +0 -15
- package/esm/actions/ContinueAction.js +0 -31
- package/esm/actions/CopyAction.d.ts +0 -20
- package/esm/actions/CopyAction.js +0 -39
- package/esm/actions/CustomAction.d.ts +0 -22
- package/esm/actions/CustomAction.js +0 -74
- package/esm/actions/DialogAction.d.ts +0 -60
- package/esm/actions/DialogAction.js +0 -101
- package/esm/actions/DrawerAction.d.ts +0 -33
- package/esm/actions/DrawerAction.js +0 -65
- package/esm/actions/EmailAction.d.ts +0 -23
- package/esm/actions/EmailAction.js +0 -39
- package/esm/actions/LinkAction.d.ts +0 -24
- package/esm/actions/LinkAction.js +0 -43
- package/esm/actions/LoopAction.d.ts +0 -19
- package/esm/actions/LoopAction.js +0 -103
- package/esm/actions/PageAction.d.ts +0 -39
- package/esm/actions/PageAction.js +0 -74
- package/esm/actions/ParallelAction.d.ts +0 -8
- package/esm/actions/ParallelAction.js +0 -36
- package/esm/actions/SwitchAction.d.ts +0 -11
- package/esm/actions/SwitchAction.js +0 -48
- package/esm/actions/ToastAction.d.ts +0 -19
- package/esm/actions/ToastAction.js +0 -31
- package/esm/actions/index.d.ts +0 -20
- package/esm/components/LazyComponent.d.ts +0 -32
- package/esm/components/LazyComponent.js +0 -90
- package/esm/components/Overlay.d.ts +0 -44
- package/esm/components/Overlay.js +0 -255
- package/esm/components/PopOver.d.ts +0 -90
- package/esm/components/PopOver.js +0 -120
- package/esm/env.d.ts +0 -176
- package/esm/env.js +0 -12
- package/esm/envOverwrite.d.ts +0 -4
- package/esm/envOverwrite.js +0 -39
- package/esm/factory.d.ts +0 -85
- package/esm/factory.js +0 -301
- package/esm/index.d.ts +0 -44
- package/esm/index.js +0 -174
- package/esm/locale.d.ts +0 -84
- package/esm/locale.js +0 -117
- package/esm/renderers/Form.d.ts +0 -389
- package/esm/renderers/Form.js +0 -1221
- package/esm/renderers/Item.d.ts +0 -906
- package/esm/renderers/Item.js +0 -863
- package/esm/renderers/Options.d.ts +0 -158
- package/esm/renderers/Options.js +0 -908
- package/esm/renderers/Placeholder.d.ts +0 -6
- package/esm/renderers/Placeholder.js +0 -23
- package/esm/renderers/builtin.d.ts +0 -1
- package/esm/renderers/builtin.js +0 -25
- package/esm/renderers/register.d.ts +0 -6
- package/esm/renderers/register.js +0 -79
- package/esm/renderers/wrapControl.d.ts +0 -437
- package/esm/renderers/wrapControl.js +0 -509
- package/esm/store/app.d.ts +0 -92
- package/esm/store/app.js +0 -189
- package/esm/store/combo.d.ts +0 -10223
- package/esm/store/combo.js +0 -149
- package/esm/store/crud.d.ts +0 -128
- package/esm/store/crud.js +0 -447
- package/esm/store/form.d.ts +0 -4252
- package/esm/store/form.js +0 -650
- package/esm/store/formItem.d.ts +0 -133
- package/esm/store/formItem.js +0 -847
- package/esm/store/iRenderer.d.ts +0 -46
- package/esm/store/iRenderer.js +0 -185
- package/esm/store/index.d.ts +0 -125
- package/esm/store/index.js +0 -90
- package/esm/store/list.d.ts +0 -272
- package/esm/store/list.js +0 -246
- package/esm/store/manager.d.ts +0 -115
- package/esm/store/manager.js +0 -49
- package/esm/store/modal.d.ts +0 -84
- package/esm/store/modal.js +0 -50
- package/esm/store/node.d.ts +0 -22
- package/esm/store/node.js +0 -89
- package/esm/store/pagination.d.ts +0 -58
- package/esm/store/pagination.js +0 -56
- package/esm/store/root.d.ts +0 -85
- package/esm/store/root.js +0 -53
- package/esm/store/service.d.ts +0 -71
- package/esm/store/service.js +0 -411
- package/esm/store/table.d.ts +0 -10085
- package/esm/store/table.js +0 -1136
- package/esm/store/table2.d.ts +0 -474
- package/esm/store/table2.js +0 -560
- package/esm/theme.d.ts +0 -89
- package/esm/theme.js +0 -127
- package/esm/types.d.ts +0 -489
- package/esm/utils/Animation.d.ts +0 -22
- package/esm/utils/Animation.js +0 -285
- package/esm/utils/ColorScale.d.ts +0 -19
- package/esm/utils/ColorScale.js +0 -100
- package/esm/utils/DataSchema.d.ts +0 -25
- package/esm/utils/DataSchema.js +0 -112
- package/esm/utils/DataScope.d.ts +0 -26
- package/esm/utils/DataScope.js +0 -158
- package/esm/utils/RootClose.d.ts +0 -4
- package/esm/utils/RootClose.js +0 -22
- package/esm/utils/SimpleMap.d.ts +0 -8
- package/esm/utils/SimpleMap.js +0 -37
- package/esm/utils/api.d.ts +0 -34
- package/esm/utils/api.js +0 -595
- package/esm/utils/attachmentAdpator.d.ts +0 -8
- package/esm/utils/attachmentAdpator.js +0 -86
- package/esm/utils/autobind.d.ts +0 -7
- package/esm/utils/autobind.js +0 -89
- package/esm/utils/columnsSplit.d.ts +0 -1
- package/esm/utils/columnsSplit.js +0 -42
- package/esm/utils/dataMapping.d.ts +0 -9
- package/esm/utils/dataMapping.js +0 -141
- package/esm/utils/date.d.ts +0 -4
- package/esm/utils/date.js +0 -80
- package/esm/utils/debug.d.ts +0 -29
- package/esm/utils/debug.js +0 -379
- package/esm/utils/decodeEntity.d.ts +0 -5
- package/esm/utils/decodeEntity.js +0 -16
- package/esm/utils/dom.d.ts +0 -13
- package/esm/utils/dom.js +0 -188
- package/esm/utils/errors.d.ts +0 -6
- package/esm/utils/errors.js +0 -19
- package/esm/utils/escapeHtml.d.ts +0 -1
- package/esm/utils/escapeHtml.js +0 -20
- package/esm/utils/filter-schema.d.ts +0 -13
- package/esm/utils/filter-schema.js +0 -68
- package/esm/utils/filter.d.ts +0 -1
- package/esm/utils/filter.js +0 -493
- package/esm/utils/formatDuration.d.ts +0 -1
- package/esm/utils/formatDuration.js +0 -23
- package/esm/utils/formula.d.ts +0 -16
- package/esm/utils/formula.js +0 -219
- package/esm/utils/getVariable.d.ts +0 -3
- package/esm/utils/getVariable.js +0 -25
- package/esm/utils/grammar.d.ts +0 -4
- package/esm/utils/grammar.js +0 -50
- package/esm/utils/handleAction.d.ts +0 -7
- package/esm/utils/handleAction.js +0 -34
- package/esm/utils/helper.d.ts +0 -323
- package/esm/utils/helper.js +0 -1261
- package/esm/utils/highlight.d.ts +0 -1
- package/esm/utils/highlight.js +0 -44
- package/esm/utils/icon.d.ts +0 -16
- package/esm/utils/icon.js +0 -35
- package/esm/utils/image.d.ts +0 -18
- package/esm/utils/image.js +0 -47
- package/esm/utils/index.d.ts +0 -55
- package/esm/utils/isPureVariable.d.ts +0 -1
- package/esm/utils/isPureVariable.js +0 -22
- package/esm/utils/json-schema-2-amis-schema.d.ts +0 -6
- package/esm/utils/json-schema-2-amis-schema.js +0 -56
- package/esm/utils/keyToPath.d.ts +0 -6
- package/esm/utils/keyToPath.js +0 -30
- package/esm/utils/makeSorter.d.ts +0 -1
- package/esm/utils/makeSorter.js +0 -26
- package/esm/utils/normalizeLink.d.ts +0 -1
- package/esm/utils/normalizeLink.js +0 -43
- package/esm/utils/normalizeOptions.d.ts +0 -7
- package/esm/utils/normalizeOptions.js +0 -84
- package/esm/utils/object.d.ts +0 -15
- package/esm/utils/object.js +0 -142
- package/esm/utils/offset.d.ts +0 -15
- package/esm/utils/offset.js +0 -32
- package/esm/utils/offsetParent.d.ts +0 -5
- package/esm/utils/offsetParent.js +0 -23
- package/esm/utils/optionValueCompare.d.ts +0 -3
- package/esm/utils/optionValueCompare.js +0 -25
- package/esm/utils/position.d.ts +0 -26
- package/esm/utils/position.js +0 -54
- package/esm/utils/prettyBytes.d.ts +0 -1
- package/esm/utils/prettyBytes.js +0 -25
- package/esm/utils/renderer-event.d.ts +0 -62
- package/esm/utils/renderer-event.js +0 -206
- package/esm/utils/replaceText.d.ts +0 -3
- package/esm/utils/replaceText.js +0 -38
- package/esm/utils/resize-sensor.d.ts +0 -6
- package/esm/utils/resize-sensor.js +0 -172
- package/esm/utils/resolveVariable.d.ts +0 -1
- package/esm/utils/resolveVariable.js +0 -35
- package/esm/utils/resolveVariableAndFilter.d.ts +0 -1
- package/esm/utils/resolveVariableAndFilter.js +0 -33
- package/esm/utils/scrollPosition.d.ts +0 -16
- package/esm/utils/scrollPosition.js +0 -33
- package/esm/utils/string2regExp.d.ts +0 -1
- package/esm/utils/string2regExp.js +0 -14
- package/esm/utils/stripNumber.d.ts +0 -1
- package/esm/utils/stripNumber.js +0 -16
- package/esm/utils/style.d.ts +0 -10
- package/esm/utils/style.js +0 -58
- package/esm/utils/toNumber.d.ts +0 -7
- package/esm/utils/toNumber.js +0 -18
- package/esm/utils/tokenize.d.ts +0 -1
- package/esm/utils/tokenize.js +0 -29
- package/esm/utils/tpl-builtin.d.ts +0 -18
- package/esm/utils/tpl-builtin.js +0 -59
- package/esm/utils/tpl-lodash.d.ts +0 -4
- package/esm/utils/tpl-lodash.js +0 -62
- package/esm/utils/tpl.d.ts +0 -11
- package/esm/utils/tpl.js +0 -131
- package/esm/utils/uncontrollable.d.ts +0 -4
- package/esm/utils/uncontrollable.js +0 -14
- package/esm/utils/validations.d.ts +0 -39
- package/esm/utils/validations.js +0 -440
- package/lib/Root.d.ts +0 -46
- package/lib/Root.js +0 -102
- package/lib/RootRenderer.d.ts +0 -27
- package/lib/RootRenderer.js +0 -290
- package/lib/SchemaRenderer.d.ts +0 -37
- package/lib/SchemaRenderer.js +0 -342
- package/lib/Scoped.d.ts +0 -38
- package/lib/Scoped.js +0 -274
- package/lib/WithRootStore.d.ts +0 -719
- package/lib/WithRootStore.js +0 -44
- package/lib/WithStore.d.ts +0 -5
- package/lib/WithStore.js +0 -190
- package/lib/actions/Action.d.ts +0 -40
- package/lib/actions/Action.js +0 -197
- package/lib/actions/AjaxAction.d.ts +0 -27
- package/lib/actions/AjaxAction.js +0 -100
- package/lib/actions/BreakAction.d.ts +0 -15
- package/lib/actions/BreakAction.js +0 -35
- package/lib/actions/BroadcastAction.d.ts +0 -19
- package/lib/actions/BroadcastAction.js +0 -50
- package/lib/actions/CmptAction.d.ts +0 -21
- package/lib/actions/CmptAction.js +0 -70
- package/lib/actions/ContinueAction.d.ts +0 -15
- package/lib/actions/ContinueAction.js +0 -35
- package/lib/actions/CopyAction.d.ts +0 -20
- package/lib/actions/CopyAction.js +0 -43
- package/lib/actions/CustomAction.d.ts +0 -22
- package/lib/actions/CustomAction.js +0 -78
- package/lib/actions/DialogAction.d.ts +0 -60
- package/lib/actions/DialogAction.js +0 -108
- package/lib/actions/DrawerAction.d.ts +0 -33
- package/lib/actions/DrawerAction.js +0 -70
- package/lib/actions/EmailAction.d.ts +0 -23
- package/lib/actions/EmailAction.js +0 -48
- package/lib/actions/LinkAction.d.ts +0 -24
- package/lib/actions/LinkAction.js +0 -47
- package/lib/actions/LoopAction.d.ts +0 -19
- package/lib/actions/LoopAction.js +0 -107
- package/lib/actions/PageAction.d.ts +0 -39
- package/lib/actions/PageAction.js +0 -80
- package/lib/actions/ParallelAction.d.ts +0 -8
- package/lib/actions/ParallelAction.js +0 -40
- package/lib/actions/SwitchAction.d.ts +0 -11
- package/lib/actions/SwitchAction.js +0 -52
- package/lib/actions/ToastAction.d.ts +0 -19
- package/lib/actions/ToastAction.js +0 -35
- package/lib/actions/index.d.ts +0 -20
- package/lib/components/LazyComponent.d.ts +0 -32
- package/lib/components/LazyComponent.js +0 -99
- package/lib/components/Overlay.d.ts +0 -44
- package/lib/components/Overlay.js +0 -266
- package/lib/components/PopOver.d.ts +0 -90
- package/lib/components/PopOver.js +0 -129
- package/lib/env.d.ts +0 -176
- package/lib/env.js +0 -20
- package/lib/envOverwrite.d.ts +0 -4
- package/lib/envOverwrite.js +0 -43
- package/lib/factory.d.ts +0 -85
- package/lib/factory.js +0 -324
- package/lib/index.d.ts +0 -44
- package/lib/index.js +0 -460
- package/lib/locale.d.ts +0 -84
- package/lib/locale.js +0 -133
- package/lib/renderers/Form.d.ts +0 -389
- package/lib/renderers/Form.js +0 -1234
- package/lib/renderers/Item.d.ts +0 -906
- package/lib/renderers/Item.js +0 -879
- package/lib/renderers/Options.d.ts +0 -158
- package/lib/renderers/Options.js +0 -920
- package/lib/renderers/Placeholder.d.ts +0 -6
- package/lib/renderers/Placeholder.js +0 -31
- package/lib/renderers/builtin.d.ts +0 -1
- package/lib/renderers/builtin.js +0 -27
- package/lib/renderers/register.d.ts +0 -6
- package/lib/renderers/register.js +0 -83
- package/lib/renderers/wrapControl.d.ts +0 -437
- package/lib/renderers/wrapControl.js +0 -520
- package/lib/store/app.d.ts +0 -92
- package/lib/store/app.js +0 -193
- package/lib/store/combo.d.ts +0 -10223
- package/lib/store/combo.js +0 -154
- package/lib/store/crud.d.ts +0 -128
- package/lib/store/crud.js +0 -455
- package/lib/store/form.d.ts +0 -4252
- package/lib/store/form.js +0 -664
- package/lib/store/formItem.d.ts +0 -133
- package/lib/store/formItem.js +0 -858
- package/lib/store/iRenderer.d.ts +0 -46
- package/lib/store/iRenderer.js +0 -189
- package/lib/store/index.d.ts +0 -125
- package/lib/store/index.js +0 -101
- package/lib/store/list.d.ts +0 -272
- package/lib/store/list.js +0 -256
- package/lib/store/manager.d.ts +0 -115
- package/lib/store/manager.js +0 -56
- package/lib/store/modal.d.ts +0 -84
- package/lib/store/modal.js +0 -54
- package/lib/store/node.d.ts +0 -22
- package/lib/store/node.js +0 -93
- package/lib/store/pagination.d.ts +0 -58
- package/lib/store/pagination.js +0 -60
- package/lib/store/root.d.ts +0 -85
- package/lib/store/root.js +0 -57
- package/lib/store/service.d.ts +0 -71
- package/lib/store/service.js +0 -415
- package/lib/store/table.d.ts +0 -10085
- package/lib/store/table.js +0 -1148
- package/lib/store/table2.d.ts +0 -474
- package/lib/store/table2.js +0 -571
- package/lib/theme.d.ts +0 -89
- package/lib/theme.js +0 -145
- package/lib/types.d.ts +0 -489
- package/lib/utils/Animation.d.ts +0 -22
- package/lib/utils/Animation.js +0 -290
- package/lib/utils/ColorScale.d.ts +0 -19
- package/lib/utils/ColorScale.js +0 -105
- package/lib/utils/DataSchema.d.ts +0 -25
- package/lib/utils/DataSchema.js +0 -116
- package/lib/utils/DataScope.d.ts +0 -26
- package/lib/utils/DataScope.js +0 -162
- package/lib/utils/RootClose.d.ts +0 -4
- package/lib/utils/RootClose.js +0 -30
- package/lib/utils/SimpleMap.d.ts +0 -8
- package/lib/utils/SimpleMap.js +0 -46
- package/lib/utils/api.d.ts +0 -34
- package/lib/utils/api.js +0 -621
- package/lib/utils/attachmentAdpator.d.ts +0 -8
- package/lib/utils/attachmentAdpator.js +0 -91
- package/lib/utils/autobind.d.ts +0 -7
- package/lib/utils/autobind.js +0 -94
- package/lib/utils/columnsSplit.d.ts +0 -1
- package/lib/utils/columnsSplit.js +0 -51
- package/lib/utils/dataMapping.d.ts +0 -9
- package/lib/utils/dataMapping.js +0 -151
- package/lib/utils/date.d.ts +0 -4
- package/lib/utils/date.js +0 -90
- package/lib/utils/debug.d.ts +0 -29
- package/lib/utils/debug.js +0 -392
- package/lib/utils/decodeEntity.d.ts +0 -5
- package/lib/utils/decodeEntity.js +0 -20
- package/lib/utils/dom.d.ts +0 -13
- package/lib/utils/dom.js +0 -199
- package/lib/utils/errors.d.ts +0 -6
- package/lib/utils/errors.js +0 -23
- package/lib/utils/escapeHtml.d.ts +0 -1
- package/lib/utils/escapeHtml.js +0 -24
- package/lib/utils/filter-schema.d.ts +0 -13
- package/lib/utils/filter-schema.js +0 -78
- package/lib/utils/filter.d.ts +0 -1
- package/lib/utils/filter.js +0 -503
- package/lib/utils/formatDuration.d.ts +0 -1
- package/lib/utils/formatDuration.js +0 -27
- package/lib/utils/formula.d.ts +0 -16
- package/lib/utils/formula.js +0 -234
- package/lib/utils/getVariable.d.ts +0 -3
- package/lib/utils/getVariable.js +0 -29
- package/lib/utils/grammar.d.ts +0 -4
- package/lib/utils/grammar.js +0 -54
- package/lib/utils/handleAction.d.ts +0 -7
- package/lib/utils/handleAction.js +0 -39
- package/lib/utils/helper.d.ts +0 -323
- package/lib/utils/helper.js +0 -1361
- package/lib/utils/highlight.d.ts +0 -1
- package/lib/utils/highlight.js +0 -52
- package/lib/utils/icon.d.ts +0 -16
- package/lib/utils/icon.js +0 -43
- package/lib/utils/image.d.ts +0 -18
- package/lib/utils/image.js +0 -56
- package/lib/utils/index.d.ts +0 -55
- package/lib/utils/isPureVariable.d.ts +0 -1
- package/lib/utils/isPureVariable.js +0 -26
- package/lib/utils/json-schema-2-amis-schema.d.ts +0 -6
- package/lib/utils/json-schema-2-amis-schema.js +0 -60
- package/lib/utils/keyToPath.d.ts +0 -6
- package/lib/utils/keyToPath.js +0 -34
- package/lib/utils/makeSorter.d.ts +0 -1
- package/lib/utils/makeSorter.js +0 -30
- package/lib/utils/normalizeLink.d.ts +0 -1
- package/lib/utils/normalizeLink.js +0 -47
- package/lib/utils/normalizeOptions.d.ts +0 -7
- package/lib/utils/normalizeOptions.js +0 -92
- package/lib/utils/object.d.ts +0 -15
- package/lib/utils/object.js +0 -156
- package/lib/utils/offset.d.ts +0 -15
- package/lib/utils/offset.js +0 -37
- package/lib/utils/offsetParent.d.ts +0 -5
- package/lib/utils/offsetParent.js +0 -28
- package/lib/utils/optionValueCompare.d.ts +0 -3
- package/lib/utils/optionValueCompare.js +0 -30
- package/lib/utils/position.d.ts +0 -26
- package/lib/utils/position.js +0 -59
- package/lib/utils/prettyBytes.d.ts +0 -1
- package/lib/utils/prettyBytes.js +0 -29
- package/lib/utils/renderer-event.d.ts +0 -62
- package/lib/utils/renderer-event.js +0 -218
- package/lib/utils/replaceText.d.ts +0 -3
- package/lib/utils/replaceText.js +0 -46
- package/lib/utils/resize-sensor.d.ts +0 -6
- package/lib/utils/resize-sensor.js +0 -177
- package/lib/utils/resolveVariable.d.ts +0 -1
- package/lib/utils/resolveVariable.js +0 -39
- package/lib/utils/resolveVariableAndFilter.d.ts +0 -1
- package/lib/utils/resolveVariableAndFilter.js +0 -37
- package/lib/utils/scrollPosition.d.ts +0 -16
- package/lib/utils/scrollPosition.js +0 -37
- package/lib/utils/string2regExp.d.ts +0 -1
- package/lib/utils/string2regExp.js +0 -18
- package/lib/utils/stripNumber.d.ts +0 -1
- package/lib/utils/stripNumber.js +0 -20
- package/lib/utils/style.d.ts +0 -10
- package/lib/utils/style.js +0 -67
- package/lib/utils/toNumber.d.ts +0 -7
- package/lib/utils/toNumber.js +0 -22
- package/lib/utils/tokenize.d.ts +0 -1
- package/lib/utils/tokenize.js +0 -33
- package/lib/utils/tpl-builtin.d.ts +0 -18
- package/lib/utils/tpl-builtin.js +0 -75
- package/lib/utils/tpl-lodash.d.ts +0 -4
- package/lib/utils/tpl-lodash.js +0 -71
- package/lib/utils/tpl.d.ts +0 -11
- package/lib/utils/tpl.js +0 -140
- package/lib/utils/uncontrollable.d.ts +0 -4
- package/lib/utils/uncontrollable.js +0 -22
- package/lib/utils/validations.d.ts +0 -39
- package/lib/utils/validations.js +0 -455
package/lib/store/list.d.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { SnapshotIn, Instance } from 'mobx-state-tree';
|
|
2
|
-
export declare const Item: import("mobx-state-tree").IModelType<{
|
|
3
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
4
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
5
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
6
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
7
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
8
|
-
}, {
|
|
9
|
-
readonly checked: boolean;
|
|
10
|
-
readonly modified: boolean;
|
|
11
|
-
readonly moved: boolean;
|
|
12
|
-
readonly locals: any;
|
|
13
|
-
readonly checkable: boolean;
|
|
14
|
-
readonly draggable: boolean;
|
|
15
|
-
} & {
|
|
16
|
-
toggle(): void;
|
|
17
|
-
change(values: object, savePristine?: boolean): void;
|
|
18
|
-
reset(): void;
|
|
19
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
20
|
-
export type IItem = Instance<typeof Item>;
|
|
21
|
-
export type SItem = SnapshotIn<typeof Item>;
|
|
22
|
-
export declare const ListStore: import("mobx-state-tree").IModelType<{
|
|
23
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
24
|
-
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
25
|
-
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
26
|
-
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
27
|
-
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
28
|
-
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
29
|
-
} & {
|
|
30
|
-
hasRemoteData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
31
|
-
data: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
32
|
-
initedAt: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
33
|
-
updatedAt: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
34
|
-
pristine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
35
|
-
action: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
36
|
-
dialogOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
37
|
-
dialogData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
38
|
-
drawerOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
39
|
-
drawerData: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<any, any, any>, [undefined]>;
|
|
40
|
-
} & {
|
|
41
|
-
items: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
42
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
43
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
44
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
45
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
46
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
47
|
-
}, {
|
|
48
|
-
readonly checked: boolean;
|
|
49
|
-
readonly modified: boolean;
|
|
50
|
-
readonly moved: boolean;
|
|
51
|
-
readonly locals: any;
|
|
52
|
-
readonly checkable: boolean;
|
|
53
|
-
readonly draggable: boolean;
|
|
54
|
-
} & {
|
|
55
|
-
toggle(): void;
|
|
56
|
-
change(values: object, savePristine?: boolean): void;
|
|
57
|
-
reset(): void;
|
|
58
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
59
|
-
selectedItems: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IModelType<{
|
|
60
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
61
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
62
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
63
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
64
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
65
|
-
}, {
|
|
66
|
-
readonly checked: boolean;
|
|
67
|
-
readonly modified: boolean;
|
|
68
|
-
readonly moved: boolean;
|
|
69
|
-
readonly locals: any;
|
|
70
|
-
readonly checkable: boolean;
|
|
71
|
-
readonly draggable: boolean;
|
|
72
|
-
} & {
|
|
73
|
-
toggle(): void;
|
|
74
|
-
change(values: object, savePristine?: boolean): void;
|
|
75
|
-
reset(): void;
|
|
76
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
77
|
-
primaryField: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
78
|
-
orderBy: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
79
|
-
orderDir: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ITypeUnion<"desc" | "asc", "desc" | "asc", "desc" | "asc">, [undefined]>;
|
|
80
|
-
draggable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
81
|
-
dragging: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
82
|
-
multiple: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
83
|
-
selectable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
84
|
-
itemCheckableOn: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
85
|
-
itemDraggableOn: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
86
|
-
hideCheckToggler: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
87
|
-
}, {
|
|
88
|
-
readonly parentStore: any;
|
|
89
|
-
readonly __: any;
|
|
90
|
-
readonly hasChildren: boolean;
|
|
91
|
-
readonly children: any[];
|
|
92
|
-
} & {
|
|
93
|
-
onChildStoreDispose(child: any): void;
|
|
94
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
95
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
96
|
-
addChildId: (id: string) => void;
|
|
97
|
-
removeChildId: (id: string) => void;
|
|
98
|
-
} & {
|
|
99
|
-
getValueByName(name: string, canAccessSuper?: boolean): any;
|
|
100
|
-
getPristineValueByName(name: string): any;
|
|
101
|
-
} & {
|
|
102
|
-
initData(data?: object, skipSetPristine?: boolean): void;
|
|
103
|
-
reset(): void;
|
|
104
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
105
|
-
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
106
|
-
setCurrentAction(action: object): void;
|
|
107
|
-
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined): void;
|
|
108
|
-
closeDialog(result?: any): void;
|
|
109
|
-
openDrawer(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined): void;
|
|
110
|
-
closeDrawer(result?: any): void;
|
|
111
|
-
} & {
|
|
112
|
-
readonly allChecked: boolean;
|
|
113
|
-
readonly checkableItems: ({
|
|
114
|
-
id: string;
|
|
115
|
-
pristine: any;
|
|
116
|
-
data: any;
|
|
117
|
-
index: number;
|
|
118
|
-
newIndex: number;
|
|
119
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
120
|
-
readonly checked: boolean;
|
|
121
|
-
readonly modified: boolean;
|
|
122
|
-
readonly moved: boolean;
|
|
123
|
-
readonly locals: any;
|
|
124
|
-
readonly checkable: boolean;
|
|
125
|
-
readonly draggable: boolean;
|
|
126
|
-
} & {
|
|
127
|
-
toggle(): void;
|
|
128
|
-
change(values: object, savePristine?: boolean): void;
|
|
129
|
-
reset(): void;
|
|
130
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
131
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
132
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
133
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
134
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
135
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
136
|
-
}, {
|
|
137
|
-
readonly checked: boolean;
|
|
138
|
-
readonly modified: boolean;
|
|
139
|
-
readonly moved: boolean;
|
|
140
|
-
readonly locals: any;
|
|
141
|
-
readonly checkable: boolean;
|
|
142
|
-
readonly draggable: boolean;
|
|
143
|
-
} & {
|
|
144
|
-
toggle(): void;
|
|
145
|
-
change(values: object, savePristine?: boolean): void;
|
|
146
|
-
reset(): void;
|
|
147
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
148
|
-
readonly unSelectedItems: ({
|
|
149
|
-
id: string;
|
|
150
|
-
pristine: any;
|
|
151
|
-
data: any;
|
|
152
|
-
index: number;
|
|
153
|
-
newIndex: number;
|
|
154
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
155
|
-
readonly checked: boolean;
|
|
156
|
-
readonly modified: boolean;
|
|
157
|
-
readonly moved: boolean;
|
|
158
|
-
readonly locals: any;
|
|
159
|
-
readonly checkable: boolean;
|
|
160
|
-
readonly draggable: boolean;
|
|
161
|
-
} & {
|
|
162
|
-
toggle(): void;
|
|
163
|
-
change(values: object, savePristine?: boolean): void;
|
|
164
|
-
reset(): void;
|
|
165
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
166
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
167
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
168
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
169
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
170
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
171
|
-
}, {
|
|
172
|
-
readonly checked: boolean;
|
|
173
|
-
readonly modified: boolean;
|
|
174
|
-
readonly moved: boolean;
|
|
175
|
-
readonly locals: any;
|
|
176
|
-
readonly checkable: boolean;
|
|
177
|
-
readonly draggable: boolean;
|
|
178
|
-
} & {
|
|
179
|
-
toggle(): void;
|
|
180
|
-
change(values: object, savePristine?: boolean): void;
|
|
181
|
-
reset(): void;
|
|
182
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
183
|
-
isSelected: (item: IItem) => boolean;
|
|
184
|
-
readonly modified: number;
|
|
185
|
-
readonly modifiedItems: ({
|
|
186
|
-
id: string;
|
|
187
|
-
pristine: any;
|
|
188
|
-
data: any;
|
|
189
|
-
index: number;
|
|
190
|
-
newIndex: number;
|
|
191
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
192
|
-
readonly checked: boolean;
|
|
193
|
-
readonly modified: boolean;
|
|
194
|
-
readonly moved: boolean;
|
|
195
|
-
readonly locals: any;
|
|
196
|
-
readonly checkable: boolean;
|
|
197
|
-
readonly draggable: boolean;
|
|
198
|
-
} & {
|
|
199
|
-
toggle(): void;
|
|
200
|
-
change(values: object, savePristine?: boolean): void;
|
|
201
|
-
reset(): void;
|
|
202
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
203
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
204
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
205
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
206
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
207
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
208
|
-
}, {
|
|
209
|
-
readonly checked: boolean;
|
|
210
|
-
readonly modified: boolean;
|
|
211
|
-
readonly moved: boolean;
|
|
212
|
-
readonly locals: any;
|
|
213
|
-
readonly checkable: boolean;
|
|
214
|
-
readonly draggable: boolean;
|
|
215
|
-
} & {
|
|
216
|
-
toggle(): void;
|
|
217
|
-
change(values: object, savePristine?: boolean): void;
|
|
218
|
-
reset(): void;
|
|
219
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
220
|
-
readonly moved: number;
|
|
221
|
-
readonly movedItems: ({
|
|
222
|
-
id: string;
|
|
223
|
-
pristine: any;
|
|
224
|
-
data: any;
|
|
225
|
-
index: number;
|
|
226
|
-
newIndex: number;
|
|
227
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
228
|
-
readonly checked: boolean;
|
|
229
|
-
readonly modified: boolean;
|
|
230
|
-
readonly moved: boolean;
|
|
231
|
-
readonly locals: any;
|
|
232
|
-
readonly checkable: boolean;
|
|
233
|
-
readonly draggable: boolean;
|
|
234
|
-
} & {
|
|
235
|
-
toggle(): void;
|
|
236
|
-
change(values: object, savePristine?: boolean): void;
|
|
237
|
-
reset(): void;
|
|
238
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
239
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
240
|
-
pristine: import("mobx-state-tree").IType<any, any, any>;
|
|
241
|
-
data: import("mobx-state-tree").IType<any, any, any>;
|
|
242
|
-
index: import("mobx-state-tree").ISimpleType<number>;
|
|
243
|
-
newIndex: import("mobx-state-tree").ISimpleType<number>;
|
|
244
|
-
}, {
|
|
245
|
-
readonly checked: boolean;
|
|
246
|
-
readonly modified: boolean;
|
|
247
|
-
readonly moved: boolean;
|
|
248
|
-
readonly locals: any;
|
|
249
|
-
readonly checkable: boolean;
|
|
250
|
-
readonly draggable: boolean;
|
|
251
|
-
} & {
|
|
252
|
-
toggle(): void;
|
|
253
|
-
change(values: object, savePristine?: boolean): void;
|
|
254
|
-
reset(): void;
|
|
255
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
256
|
-
} & {
|
|
257
|
-
update: (config: Partial<SListStore>) => void;
|
|
258
|
-
initItems: (items: Array<object>) => void;
|
|
259
|
-
updateSelected: (selected: Array<any>, valueField?: string) => void;
|
|
260
|
-
toggleAll: () => void;
|
|
261
|
-
clearAll: () => void;
|
|
262
|
-
selectAll: () => void;
|
|
263
|
-
toggle: (item: IItem) => void;
|
|
264
|
-
clear: () => void;
|
|
265
|
-
setOrderByInfo: (key: string, direction: 'asc' | 'desc') => void;
|
|
266
|
-
reset: () => void;
|
|
267
|
-
toggleDragging: () => void;
|
|
268
|
-
stopDragging: () => void;
|
|
269
|
-
exchange: (fromIndex: number, toIndex: number) => void;
|
|
270
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
271
|
-
export type IListStore = Instance<typeof ListStore>;
|
|
272
|
-
export type SListStore = SnapshotIn<typeof ListStore>;
|
package/lib/store/list.js
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* amis-core v2.6.0
|
|
3
|
-
* Copyright 2018-2022 fex
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
-
|
|
10
|
-
var mobxStateTree = require('mobx-state-tree');
|
|
11
|
-
var iRenderer = require('./iRenderer.js');
|
|
12
|
-
var isEqual = require('lodash/isEqual');
|
|
13
|
-
var find = require('lodash/find');
|
|
14
|
-
var helper = require('../utils/helper.js');
|
|
15
|
-
var tpl = require('../utils/tpl.js');
|
|
16
|
-
var object = require('../utils/object.js');
|
|
17
|
-
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
21
|
-
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
|
|
22
|
-
|
|
23
|
-
var Item = mobxStateTree.types
|
|
24
|
-
.model('Item', {
|
|
25
|
-
id: mobxStateTree.types.identifier,
|
|
26
|
-
pristine: mobxStateTree.types.frozen(),
|
|
27
|
-
data: mobxStateTree.types.frozen(),
|
|
28
|
-
index: mobxStateTree.types.number,
|
|
29
|
-
newIndex: mobxStateTree.types.number
|
|
30
|
-
})
|
|
31
|
-
.views(function (self) { return ({
|
|
32
|
-
get checked() {
|
|
33
|
-
return mobxStateTree.getParent(self, 2).isSelected(self);
|
|
34
|
-
},
|
|
35
|
-
get modified() {
|
|
36
|
-
if (!self.data) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
return Object.keys(self.data).some(function (key) { return !isEqual__default["default"](self.data[key], self.pristine[key]); });
|
|
40
|
-
},
|
|
41
|
-
get moved() {
|
|
42
|
-
return self.index !== self.newIndex;
|
|
43
|
-
},
|
|
44
|
-
get locals() {
|
|
45
|
-
return object.createObject(object.extendObject(mobxStateTree.getParent(self, 2).data, {
|
|
46
|
-
index: self.index
|
|
47
|
-
}), self.data);
|
|
48
|
-
},
|
|
49
|
-
get checkable() {
|
|
50
|
-
var table = mobxStateTree.getParent(self, 2);
|
|
51
|
-
return table && table.itemCheckableOn
|
|
52
|
-
? tpl.evalExpression(table.itemCheckableOn, self.locals)
|
|
53
|
-
: true;
|
|
54
|
-
},
|
|
55
|
-
get draggable() {
|
|
56
|
-
var table = mobxStateTree.getParent(self, 2);
|
|
57
|
-
return table && table.itemDraggableOn
|
|
58
|
-
? tpl.evalExpression(table.itemDraggableOn, self.locals)
|
|
59
|
-
: true;
|
|
60
|
-
}
|
|
61
|
-
}); })
|
|
62
|
-
.actions(function (self) { return ({
|
|
63
|
-
toggle: function () {
|
|
64
|
-
mobxStateTree.getParent(self, 2).toggle(self);
|
|
65
|
-
},
|
|
66
|
-
change: function (values, savePristine) {
|
|
67
|
-
self.data = helper.immutableExtends(self.data, values);
|
|
68
|
-
savePristine && (self.pristine = self.data);
|
|
69
|
-
},
|
|
70
|
-
reset: function () {
|
|
71
|
-
self.newIndex = self.index;
|
|
72
|
-
self.data = self.pristine;
|
|
73
|
-
}
|
|
74
|
-
}); });
|
|
75
|
-
var ListStore = iRenderer.iRendererStore
|
|
76
|
-
.named('ListStore')
|
|
77
|
-
.props({
|
|
78
|
-
items: mobxStateTree.types.array(Item),
|
|
79
|
-
selectedItems: mobxStateTree.types.array(mobxStateTree.types.reference(Item)),
|
|
80
|
-
primaryField: 'id',
|
|
81
|
-
orderBy: '',
|
|
82
|
-
orderDir: mobxStateTree.types.optional(mobxStateTree.types.union(mobxStateTree.types.literal('asc'), mobxStateTree.types.literal('desc')), 'asc'),
|
|
83
|
-
draggable: false,
|
|
84
|
-
dragging: false,
|
|
85
|
-
multiple: true,
|
|
86
|
-
selectable: false,
|
|
87
|
-
itemCheckableOn: '',
|
|
88
|
-
itemDraggableOn: '',
|
|
89
|
-
hideCheckToggler: false
|
|
90
|
-
})
|
|
91
|
-
.views(function (self) {
|
|
92
|
-
function isSelected(item) {
|
|
93
|
-
return !!~self.selectedItems.indexOf(item);
|
|
94
|
-
}
|
|
95
|
-
function getModifiedItems() {
|
|
96
|
-
return self.items.filter(function (item) { return item.modified; });
|
|
97
|
-
}
|
|
98
|
-
function getModified() {
|
|
99
|
-
return getModifiedItems().length;
|
|
100
|
-
}
|
|
101
|
-
function getMovedItems() {
|
|
102
|
-
return self.items.filter(function (item) { return item.moved; });
|
|
103
|
-
}
|
|
104
|
-
function getMovied() {
|
|
105
|
-
return getMovedItems().length;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
get allChecked() {
|
|
109
|
-
return !!(self.selectedItems.length ===
|
|
110
|
-
self.checkableItems.length &&
|
|
111
|
-
self.checkableItems.length);
|
|
112
|
-
},
|
|
113
|
-
get checkableItems() {
|
|
114
|
-
return self.items.filter(function (item) { return item.checkable; });
|
|
115
|
-
},
|
|
116
|
-
get unSelectedItems() {
|
|
117
|
-
return self.items.filter(function (item) { return !item.checked; });
|
|
118
|
-
},
|
|
119
|
-
isSelected: isSelected,
|
|
120
|
-
get modified() {
|
|
121
|
-
return getModified();
|
|
122
|
-
},
|
|
123
|
-
get modifiedItems() {
|
|
124
|
-
return getModifiedItems();
|
|
125
|
-
},
|
|
126
|
-
get moved() {
|
|
127
|
-
return getMovied();
|
|
128
|
-
},
|
|
129
|
-
get movedItems() {
|
|
130
|
-
return getMovedItems();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
})
|
|
134
|
-
.actions(function (self) {
|
|
135
|
-
function update(config) {
|
|
136
|
-
config.selectable === void 0 || (self.selectable = config.selectable);
|
|
137
|
-
config.draggable === void 0 || (self.draggable = config.draggable);
|
|
138
|
-
config.multiple === void 0 || (self.multiple = config.multiple);
|
|
139
|
-
config.hideCheckToggler === void 0 ||
|
|
140
|
-
(self.hideCheckToggler = config.hideCheckToggler);
|
|
141
|
-
if (typeof config.orderBy !== 'undefined') {
|
|
142
|
-
setOrderByInfo(config.orderBy, config.orderDir === 'desc' ? 'desc' : 'asc');
|
|
143
|
-
}
|
|
144
|
-
config.itemCheckableOn === void 0 ||
|
|
145
|
-
(self.itemCheckableOn = config.itemCheckableOn);
|
|
146
|
-
config.itemDraggableOn === void 0 ||
|
|
147
|
-
(self.itemDraggableOn = config.itemDraggableOn);
|
|
148
|
-
}
|
|
149
|
-
function initItems(items) {
|
|
150
|
-
var arr = items.map(function (item, key) {
|
|
151
|
-
item = object.isObject(item)
|
|
152
|
-
? item
|
|
153
|
-
: {
|
|
154
|
-
item: item
|
|
155
|
-
};
|
|
156
|
-
return {
|
|
157
|
-
// id: String((item as any)[self.primaryField] || key),
|
|
158
|
-
id: helper.guid(),
|
|
159
|
-
index: key,
|
|
160
|
-
newIndex: key,
|
|
161
|
-
pristine: item,
|
|
162
|
-
data: item,
|
|
163
|
-
modified: false
|
|
164
|
-
};
|
|
165
|
-
});
|
|
166
|
-
self.selectedItems.clear();
|
|
167
|
-
self.items.replace(arr);
|
|
168
|
-
self.dragging = false;
|
|
169
|
-
}
|
|
170
|
-
function updateSelected(selected, valueField) {
|
|
171
|
-
self.selectedItems.clear();
|
|
172
|
-
self.items.forEach(function (item) {
|
|
173
|
-
if (~selected.indexOf(item.pristine)) {
|
|
174
|
-
self.selectedItems.push(item);
|
|
175
|
-
}
|
|
176
|
-
else if (find__default["default"](selected, function (a) {
|
|
177
|
-
return a[valueField || 'value'] == item.pristine[valueField || 'value'];
|
|
178
|
-
})) {
|
|
179
|
-
self.selectedItems.push(item);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
function toggleAll() {
|
|
184
|
-
if (self.allChecked) {
|
|
185
|
-
self.selectedItems.clear();
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
self.selectedItems.replace(self.checkableItems);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function clearAll() {
|
|
192
|
-
self.selectedItems.clear();
|
|
193
|
-
}
|
|
194
|
-
function selectAll() {
|
|
195
|
-
self.selectedItems.replace(self.checkableItems);
|
|
196
|
-
}
|
|
197
|
-
function toggle(item) {
|
|
198
|
-
if (!item.checkable) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
var idx = self.selectedItems.indexOf(item);
|
|
202
|
-
if (self.multiple) {
|
|
203
|
-
~idx
|
|
204
|
-
? self.selectedItems.splice(idx, 1)
|
|
205
|
-
: self.selectedItems.push(item);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
~idx
|
|
209
|
-
? self.selectedItems.splice(idx, 1)
|
|
210
|
-
: self.selectedItems.replace([item]);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function clear() {
|
|
214
|
-
self.selectedItems.clear();
|
|
215
|
-
}
|
|
216
|
-
function setOrderByInfo(key, direction) {
|
|
217
|
-
self.orderBy = key;
|
|
218
|
-
self.orderDir = direction;
|
|
219
|
-
}
|
|
220
|
-
function reset() {
|
|
221
|
-
self.items.forEach(function (item) { return item.reset(); });
|
|
222
|
-
self.dragging = false;
|
|
223
|
-
}
|
|
224
|
-
function toggleDragging() {
|
|
225
|
-
self.dragging = !self.dragging;
|
|
226
|
-
}
|
|
227
|
-
function stopDragging() {
|
|
228
|
-
self.dragging = false;
|
|
229
|
-
}
|
|
230
|
-
function exchange(fromIndex, toIndex) {
|
|
231
|
-
var item = self.items[fromIndex];
|
|
232
|
-
item.newIndex = toIndex;
|
|
233
|
-
var newItems = self.items.slice();
|
|
234
|
-
newItems.splice(fromIndex, 1);
|
|
235
|
-
newItems.splice(toIndex, 0, item);
|
|
236
|
-
self.items.replace(newItems);
|
|
237
|
-
}
|
|
238
|
-
return {
|
|
239
|
-
update: update,
|
|
240
|
-
initItems: initItems,
|
|
241
|
-
updateSelected: updateSelected,
|
|
242
|
-
toggleAll: toggleAll,
|
|
243
|
-
clearAll: clearAll,
|
|
244
|
-
selectAll: selectAll,
|
|
245
|
-
toggle: toggle,
|
|
246
|
-
clear: clear,
|
|
247
|
-
setOrderByInfo: setOrderByInfo,
|
|
248
|
-
reset: reset,
|
|
249
|
-
toggleDragging: toggleDragging,
|
|
250
|
-
stopDragging: stopDragging,
|
|
251
|
-
exchange: exchange
|
|
252
|
-
};
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
exports.Item = Item;
|
|
256
|
-
exports.ListStore = ListStore;
|
package/lib/store/manager.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { IStoreNode } from './node';
|
|
2
|
-
export declare function addStore(store: IStoreNode): {
|
|
3
|
-
id: string;
|
|
4
|
-
path: string;
|
|
5
|
-
storeType: string;
|
|
6
|
-
disposed: boolean;
|
|
7
|
-
parentId: string;
|
|
8
|
-
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
9
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
10
|
-
readonly parentStore: any;
|
|
11
|
-
readonly __: any;
|
|
12
|
-
readonly hasChildren: boolean;
|
|
13
|
-
readonly children: any[];
|
|
14
|
-
} & {
|
|
15
|
-
onChildStoreDispose(child: any): void;
|
|
16
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
17
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
18
|
-
addChildId: (id: string) => void;
|
|
19
|
-
removeChildId: (id: string) => void;
|
|
20
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
21
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
22
|
-
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
23
|
-
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
24
|
-
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
25
|
-
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
26
|
-
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
27
|
-
}, {
|
|
28
|
-
readonly parentStore: any;
|
|
29
|
-
readonly __: any;
|
|
30
|
-
readonly hasChildren: boolean;
|
|
31
|
-
readonly children: any[];
|
|
32
|
-
} & {
|
|
33
|
-
onChildStoreDispose(child: any): void;
|
|
34
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
35
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
36
|
-
addChildId: (id: string) => void;
|
|
37
|
-
removeChildId: (id: string) => void;
|
|
38
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
39
|
-
export declare function removeStore(store: IStoreNode): void;
|
|
40
|
-
export declare function getStoreById(id: string): {
|
|
41
|
-
id: string;
|
|
42
|
-
path: string;
|
|
43
|
-
storeType: string;
|
|
44
|
-
disposed: boolean;
|
|
45
|
-
parentId: string;
|
|
46
|
-
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
47
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
48
|
-
readonly parentStore: any;
|
|
49
|
-
readonly __: any;
|
|
50
|
-
readonly hasChildren: boolean;
|
|
51
|
-
readonly children: any[];
|
|
52
|
-
} & {
|
|
53
|
-
onChildStoreDispose(child: any): void;
|
|
54
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
55
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
56
|
-
addChildId: (id: string) => void;
|
|
57
|
-
removeChildId: (id: string) => void;
|
|
58
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
59
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
60
|
-
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
61
|
-
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
62
|
-
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
63
|
-
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
64
|
-
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
65
|
-
}, {
|
|
66
|
-
readonly parentStore: any;
|
|
67
|
-
readonly __: any;
|
|
68
|
-
readonly hasChildren: boolean;
|
|
69
|
-
readonly children: any[];
|
|
70
|
-
} & {
|
|
71
|
-
onChildStoreDispose(child: any): void;
|
|
72
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
73
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
74
|
-
addChildId: (id: string) => void;
|
|
75
|
-
removeChildId: (id: string) => void;
|
|
76
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
77
|
-
export declare function getStores(): {
|
|
78
|
-
[propName: string]: {
|
|
79
|
-
id: string;
|
|
80
|
-
path: string;
|
|
81
|
-
storeType: string;
|
|
82
|
-
disposed: boolean;
|
|
83
|
-
parentId: string;
|
|
84
|
-
childrenIds: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
|
|
85
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
86
|
-
readonly parentStore: any;
|
|
87
|
-
readonly __: any;
|
|
88
|
-
readonly hasChildren: boolean;
|
|
89
|
-
readonly children: any[];
|
|
90
|
-
} & {
|
|
91
|
-
onChildStoreDispose(child: any): void;
|
|
92
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
93
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
94
|
-
addChildId: (id: string) => void;
|
|
95
|
-
removeChildId: (id: string) => void;
|
|
96
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
97
|
-
id: import("mobx-state-tree").ISimpleType<string>;
|
|
98
|
-
path: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
99
|
-
storeType: import("mobx-state-tree").ISimpleType<string>;
|
|
100
|
-
disposed: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
101
|
-
parentId: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
102
|
-
childrenIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
103
|
-
}, {
|
|
104
|
-
readonly parentStore: any;
|
|
105
|
-
readonly __: any;
|
|
106
|
-
readonly hasChildren: boolean;
|
|
107
|
-
readonly children: any[];
|
|
108
|
-
} & {
|
|
109
|
-
onChildStoreDispose(child: any): void;
|
|
110
|
-
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
111
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
112
|
-
addChildId: (id: string) => void;
|
|
113
|
-
removeChildId: (id: string) => void;
|
|
114
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
115
|
-
};
|