dinocollab-core 1.0.1 → 1.0.3
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/dist/_virtual/_rollupPluginBabelHelpers.js +67 -10
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/{src/api-context → api-context}/alert-global.js +49 -34
- package/dist/api-context/alert-global.js.map +1 -0
- package/dist/{src/api-context → api-context}/drawer-global.js +40 -33
- package/dist/api-context/drawer-global.js.map +1 -0
- package/dist/{src/api-context → api-context}/global-modal.js +40 -32
- package/dist/api-context/global-modal.js.map +1 -0
- package/dist/{src/api-context → api-context}/popover-global.js +44 -36
- package/dist/api-context/popover-global.js.map +1 -0
- package/dist/api-context/popover.js +94 -0
- package/dist/api-context/popover.js.map +1 -0
- package/dist/{src/api-context → api-context}/ui.units.js +12 -10
- package/dist/api-context/ui.units.js.map +1 -0
- package/dist/components/breadcrumbs.js +65 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/{src/components → components}/copy-to-clipboard.js +39 -32
- package/dist/components/copy-to-clipboard.js.map +1 -0
- package/dist/components/help-tooltip.js +104 -0
- package/dist/components/help-tooltip.js.map +1 -0
- package/dist/components/image-with-fallback.js +51 -0
- package/dist/components/image-with-fallback.js.map +1 -0
- package/dist/{src/components → components}/text-editor.js +24 -23
- package/dist/components/text-editor.js.map +1 -0
- package/dist/components/text-editor.preview.js +27 -0
- package/dist/components/text-editor.preview.js.map +1 -0
- package/dist/form/create.autocomplete.chips.js +228 -0
- package/dist/form/create.autocomplete.chips.js.map +1 -0
- package/dist/{src/form → form}/create.date-expired.js +71 -61
- package/dist/form/create.date-expired.js.map +1 -0
- package/dist/{src/form → form}/create.date-picker.js +40 -37
- package/dist/form/create.date-picker.js.map +1 -0
- package/dist/{src/form → form}/create.form-base.js +47 -41
- package/dist/form/create.form-base.js.map +1 -0
- package/dist/form/create.form-comfirm.js +131 -0
- package/dist/form/create.form-comfirm.js.map +1 -0
- package/dist/form/create.form-grid-layout.js +188 -0
- package/dist/form/create.form-grid-layout.js.map +1 -0
- package/dist/{src/form → form}/create.form-grid-layout.units.js +17 -14
- package/dist/form/create.form-grid-layout.units.js.map +1 -0
- package/dist/form/create.input.file.js +79 -0
- package/dist/form/create.input.file.js.map +1 -0
- package/dist/form/create.input.js +276 -0
- package/dist/form/create.input.js.map +1 -0
- package/dist/form/create.select-simple.js +114 -0
- package/dist/form/create.select-simple.js.map +1 -0
- package/dist/form/create.select-with-api.js +277 -0
- package/dist/form/create.select-with-api.js.map +1 -0
- package/dist/form/create.text-editor.js +181 -0
- package/dist/form/create.text-editor.js.map +1 -0
- package/dist/{src/form → form}/dino-form.js +17 -18
- package/dist/form/dino-form.js.map +1 -0
- package/dist/{src/form → form}/helper.js +14 -14
- package/dist/form/helper.js.map +1 -0
- package/dist/{src/form → form}/modal-wrapper.js +32 -25
- package/dist/form/modal-wrapper.js.map +1 -0
- package/dist/{src/form → form}/validator.js +47 -43
- package/dist/form/validator.js.map +1 -0
- package/dist/{src/hooks → hooks}/index.js +1 -1
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +928 -0
- package/dist/{src/index.js → index.js} +10 -3
- package/dist/{src/index.js.map → index.js.map} +1 -1
- package/dist/redux/create.hoc-lazy.js +71 -0
- package/dist/redux/create.hoc-lazy.js.map +1 -0
- package/dist/{src/redux → redux}/dino.js +2 -2
- package/dist/redux/dino.js.map +1 -0
- package/dist/redux/types.js.map +1 -0
- package/dist/redux/ui.error-page.js +89 -0
- package/dist/redux/ui.error-page.js.map +1 -0
- package/dist/redux/vector-404.webp.js.map +1 -0
- package/dist/{src/table → table}/context.js +5 -2
- package/dist/table/context.js.map +1 -0
- package/dist/table/create.action-row.js +144 -0
- package/dist/table/create.action-row.js.map +1 -0
- package/dist/table/create.table.js +246 -0
- package/dist/table/create.table.js.map +1 -0
- package/dist/{src/table → table}/custom.filter-operators.js +2 -2
- package/dist/table/custom.filter-operators.js.map +1 -0
- package/dist/table/dino.js +136 -0
- package/dist/table/dino.js.map +1 -0
- package/dist/{src/table → table}/helpers.js +31 -32
- package/dist/table/helpers.js.map +1 -0
- package/dist/table/model-filter.js.map +1 -0
- package/dist/table/toolbar-pannel.js +143 -0
- package/dist/table/toolbar-pannel.js.map +1 -0
- package/dist/table/ui.buttons.js +67 -0
- package/dist/table/ui.buttons.js.map +1 -0
- package/dist/table/ui.units.js +248 -0
- package/dist/table/ui.units.js.map +1 -0
- package/dist/types/api-context/alert-global.d.ts +29 -0
- package/dist/types/api-context/drawer-global.d.ts +32 -0
- package/dist/types/api-context/global-modal.d.ts +37 -0
- package/dist/types/api-context/index.d.ts +9 -0
- package/dist/types/api-context/popover-global.d.ts +37 -0
- package/dist/types/api-context/popover.d.ts +32 -0
- package/dist/types/api-context/ui.units.d.ts +2 -0
- package/dist/types/components/breadcrumbs.d.ts +13 -0
- package/dist/types/components/copy-to-clipboard.d.ts +26 -0
- package/dist/types/components/help-tooltip.d.ts +15 -0
- package/dist/types/components/image-with-fallback.d.ts +13 -0
- package/dist/types/components/index.d.ts +11 -0
- package/dist/types/components/input-debounce-timer.d.ts +9 -0
- package/dist/types/components/loading-buttons.d.ts +6 -0
- package/dist/types/components/text-editor.d.ts +26 -0
- package/dist/types/components/text-editor.preview.d.ts +5 -0
- package/dist/types/form/create.autocomplete.chips.d.ts +16 -0
- package/dist/types/form/create.date-expired.d.ts +19 -0
- package/dist/types/form/create.date-picker.d.ts +19 -0
- package/dist/types/form/create.form-base.d.ts +30 -0
- package/dist/types/form/create.form-comfirm.d.ts +20 -0
- package/dist/types/form/create.form-grid-layout.d.ts +44 -0
- package/dist/types/form/create.form-grid-layout.units.d.ts +8 -0
- package/dist/types/form/create.input.d.ts +29 -0
- package/dist/types/form/create.input.file.d.ts +16 -0
- package/dist/types/form/create.select-simple.d.ts +24 -0
- package/dist/types/form/create.select-with-api.d.ts +29 -0
- package/dist/types/form/create.text-editor.d.ts +42 -0
- package/dist/types/form/dino-form.d.ts +26 -0
- package/dist/types/form/helper.d.ts +14 -0
- package/dist/types/form/index.d.ts +7 -0
- package/dist/types/form/modal-wrapper.d.ts +14 -0
- package/dist/types/form/types.d.ts +15 -0
- package/dist/types/form/validator.d.ts +64 -0
- package/dist/types/hooks/index.d.ts +4 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/lab/create.autocomplete.simple.d.ts +19 -0
- package/dist/types/lab/create.dino-store.d.ts +1 -0
- package/dist/types/lab/create.multi-select-dropdown.d.ts +23 -0
- package/dist/types/lab/create.select-mul-with-api/index.d.ts +26 -0
- package/dist/types/lab/create.select-mul-with-api/table-custom.d.ts +43 -0
- package/dist/types/lab/create.select-mul-with-api/types.d.ts +21 -0
- package/dist/types/lab/create.select-mul-with-api/ui.units.d.ts +29 -0
- package/dist/types/lab/filter-bar/base.d.ts +34 -0
- package/dist/types/lab/filter-bar/create.filter-bar.d.ts +92 -0
- package/dist/types/lab/filter-bar/create.filter-menu.d.ts +66 -0
- package/dist/types/lab/filter-bar/create.filter-panel.d.ts +117 -0
- package/dist/types/lab/filter-bar/create.filtered.d.ts +59 -0
- package/dist/types/lab/filter-bar/create.sort-menu.d.ts +7 -0
- package/dist/types/lab/filter-bar/demo.d.ts +3 -0
- package/dist/types/lab/filter-bar/index.d.ts +4 -0
- package/dist/types/lab/filter-bar/types.d.ts +81 -0
- package/dist/types/lab/filter-bar/ui.units.d.ts +13 -0
- package/dist/types/lab/grafana-dashboard/configs.d.ts +4 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/absolute-time-rage.d.ts +14 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/helpers.d.ts +36 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/index.d.ts +24 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/menu-wrap.d.ts +19 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/quick-ranges.d.ts +20 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/types.d.ts +8 -0
- package/dist/types/lab/grafana-dashboard/date-time-range/units.d.ts +2 -0
- package/dist/types/lab/grafana-dashboard/helper.d.ts +7 -0
- package/dist/types/lab/grafana-dashboard/hooks.d.ts +10 -0
- package/dist/types/lab/grafana-dashboard/icons.d.ts +5 -0
- package/dist/types/lab/grafana-dashboard/index.d.ts +12 -0
- package/dist/types/lab/grafana-dashboard/top-bar.d.ts +19 -0
- package/dist/types/lab/grafana-dashboard/top-bar.types.d.ts +4 -0
- package/dist/types/lab/grafana-dashboard/types.d.ts +8 -0
- package/dist/types/lab/media-player.core1.d.ts +14 -0
- package/dist/types/lab/media-player.muted.d.ts +10 -0
- package/dist/types/lab/media-player.units.d.ts +36 -0
- package/dist/types/lab/table-grid/create.table-grid.d.ts +4 -0
- package/dist/types/lab/table-grid/demo.d.ts +3 -0
- package/dist/types/lab/table-grid/dino.d.ts +6 -0
- package/dist/types/lab/table-grid/helpers.d.ts +11 -0
- package/dist/types/lab/table-grid/index.d.ts +2 -0
- package/dist/types/lab/table-grid/item-actions.d.ts +93 -0
- package/dist/types/lab/table-grid/toolbar-pannel.d.ts +27 -0
- package/dist/types/lab/table-grid/types.d.ts +56 -0
- package/dist/types/redux/create.hoc-lazy.d.ts +19 -0
- package/dist/types/redux/dino.d.ts +6 -0
- package/dist/types/redux/index.d.ts +4 -0
- package/dist/types/redux/types.d.ts +22 -0
- package/dist/types/redux/ui.error-page.d.ts +3 -0
- package/dist/types/redux/ui.units.d.ts +9 -0
- package/dist/types/table/context.d.ts +8 -0
- package/dist/types/table/create.action-row.d.ts +16 -0
- package/dist/types/table/create.table.d.ts +33 -0
- package/dist/types/table/custom.filter-operators.d.ts +2 -0
- package/dist/types/table/dino.d.ts +41 -0
- package/dist/types/table/helpers.d.ts +23 -0
- package/dist/types/table/index.d.ts +7 -0
- package/dist/types/table/model-filter.d.ts +38 -0
- package/dist/types/table/toolbar-pannel.d.ts +18 -0
- package/dist/types/table/types.d.ts +40 -0
- package/dist/types/table/ui.buttons.d.ts +16 -0
- package/dist/types/table/ui.units.d.ts +62 -0
- package/dist/types/utils/dayjs-config.d.ts +2 -0
- package/dist/types/utils/helpers.d.ts +35 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/json-object.d.ts +9 -0
- package/dist/types/utils/mfe-events.d.ts +12 -0
- package/dist/types/utils/query-param.d.ts +25 -0
- package/dist/utils/dayjs-config.js.map +1 -0
- package/dist/{src/utils → utils}/helpers.js +11 -9
- package/dist/utils/helpers.js.map +1 -0
- package/dist/{src/utils → utils}/json-object.js +13 -13
- package/dist/utils/json-object.js.map +1 -0
- package/dist/{src/utils → utils}/query-param.js +17 -17
- package/dist/utils/query-param.js.map +1 -0
- package/package.json +18 -5
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@1_d0d2002d9033600b6738d939bd598bc6/node_modules/tslib/tslib.es6.js +0 -46
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@1_d0d2002d9033600b6738d939bd598bc6/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/src/api-context/alert-global.js.map +0 -1
- package/dist/src/api-context/drawer-global.js.map +0 -1
- package/dist/src/api-context/global-modal.js.map +0 -1
- package/dist/src/api-context/popover-global.js.map +0 -1
- package/dist/src/api-context/popover.js +0 -86
- package/dist/src/api-context/popover.js.map +0 -1
- package/dist/src/api-context/ui.units.js.map +0 -1
- package/dist/src/components/copy-to-clipboard.js.map +0 -1
- package/dist/src/components/custom.breadcrumbs.js +0 -61
- package/dist/src/components/custom.breadcrumbs.js.map +0 -1
- package/dist/src/components/help-tooltip.js +0 -91
- package/dist/src/components/help-tooltip.js.map +0 -1
- package/dist/src/components/image-with-fallback.js +0 -48
- package/dist/src/components/image-with-fallback.js.map +0 -1
- package/dist/src/components/text-editor.js.map +0 -1
- package/dist/src/form/create.autocomplete.chips.js +0 -218
- package/dist/src/form/create.autocomplete.chips.js.map +0 -1
- package/dist/src/form/create.date-expired.js.map +0 -1
- package/dist/src/form/create.date-picker.js.map +0 -1
- package/dist/src/form/create.form-base.js.map +0 -1
- package/dist/src/form/create.form-comfirm.js +0 -119
- package/dist/src/form/create.form-comfirm.js.map +0 -1
- package/dist/src/form/create.form-grid-layout.js +0 -177
- package/dist/src/form/create.form-grid-layout.js.map +0 -1
- package/dist/src/form/create.form-grid-layout.units.js.map +0 -1
- package/dist/src/form/create.input-base.js +0 -260
- package/dist/src/form/create.input-base.js.map +0 -1
- package/dist/src/form/create.input.file.js +0 -74
- package/dist/src/form/create.input.file.js.map +0 -1
- package/dist/src/form/create.select-simple.js +0 -104
- package/dist/src/form/create.select-simple.js.map +0 -1
- package/dist/src/form/create.select-with-api.js +0 -271
- package/dist/src/form/create.select-with-api.js.map +0 -1
- package/dist/src/form/create.text-editor.js +0 -156
- package/dist/src/form/create.text-editor.js.map +0 -1
- package/dist/src/form/dino-form.js.map +0 -1
- package/dist/src/form/helper.js.map +0 -1
- package/dist/src/form/modal-wrapper.js.map +0 -1
- package/dist/src/form/validator.js.map +0 -1
- package/dist/src/hooks/index.js.map +0 -1
- package/dist/src/redux/create.hoc-lazy.js +0 -67
- package/dist/src/redux/create.hoc-lazy.js.map +0 -1
- package/dist/src/redux/dino.js.map +0 -1
- package/dist/src/redux/types.js.map +0 -1
- package/dist/src/redux/ui.error-page.js +0 -80
- package/dist/src/redux/ui.error-page.js.map +0 -1
- package/dist/src/redux/vector-404.webp.js.map +0 -1
- package/dist/src/table/context.js.map +0 -1
- package/dist/src/table/create.action-row.js +0 -135
- package/dist/src/table/create.action-row.js.map +0 -1
- package/dist/src/table/create.status-cell.js +0 -49
- package/dist/src/table/create.status-cell.js.map +0 -1
- package/dist/src/table/create.table.js +0 -233
- package/dist/src/table/create.table.js.map +0 -1
- package/dist/src/table/custom.filter-operators.js.map +0 -1
- package/dist/src/table/dino.js +0 -129
- package/dist/src/table/dino.js.map +0 -1
- package/dist/src/table/helpers.js.map +0 -1
- package/dist/src/table/model-filter.js.map +0 -1
- package/dist/src/table/toolbar-pannel.js +0 -134
- package/dist/src/table/toolbar-pannel.js.map +0 -1
- package/dist/src/table/ui.buttons.js +0 -60
- package/dist/src/table/ui.buttons.js.map +0 -1
- package/dist/src/table/ui.units.js +0 -201
- package/dist/src/table/ui.units.js.map +0 -1
- package/dist/src/utils/dayjs-config.js.map +0 -1
- package/dist/src/utils/helpers.js.map +0 -1
- package/dist/src/utils/json-object.js.map +0 -1
- package/dist/src/utils/query-param.js.map +0 -1
- package/rollup.config.js +0 -39
- package/src/@types/global.d.ts +0 -5
- package/src/api-context/alert-global.tsx +0 -174
- package/src/api-context/drawer-global.tsx +0 -116
- package/src/api-context/global-modal.tsx +0 -109
- package/src/api-context/index.ts +0 -13
- package/src/api-context/popover-global.tsx +0 -107
- package/src/api-context/popover.tsx +0 -89
- package/src/api-context/ui.units.tsx +0 -10
- package/src/components/copy-to-clipboard.tsx +0 -86
- package/src/components/custom.breadcrumbs.tsx +0 -67
- package/src/components/help-tooltip.tsx +0 -75
- package/src/components/image-with-fallback.tsx +0 -51
- package/src/components/index.tsx +0 -1
- package/src/components/input-debounce-timer.tsx +0 -138
- package/src/components/loading-buttons.tsx +0 -35
- package/src/components/text-editor.preview.tsx +0 -30
- package/src/components/text-editor.tsx +0 -125
- package/src/form/README.md +0 -55
- package/src/form/create.autocomplete.chips.tsx +0 -199
- package/src/form/create.date-expired.tsx +0 -195
- package/src/form/create.date-picker.tsx +0 -122
- package/src/form/create.form-base.tsx +0 -102
- package/src/form/create.form-comfirm.tsx +0 -83
- package/src/form/create.form-grid-layout.tsx +0 -170
- package/src/form/create.form-grid-layout.units.tsx +0 -37
- package/src/form/create.input-base.tsx +0 -222
- package/src/form/create.input.file.tsx +0 -76
- package/src/form/create.select-simple.tsx +0 -101
- package/src/form/create.select-with-api.tsx +0 -213
- package/src/form/create.text-editor.tsx +0 -161
- package/src/form/dino-form.tsx +0 -40
- package/src/form/helper.ts +0 -132
- package/src/form/index.ts +0 -12
- package/src/form/modal-wrapper.tsx +0 -75
- package/src/form/types.ts +0 -16
- package/src/form/validator.ts +0 -202
- package/src/hooks/index.ts +0 -44
- package/src/index.ts +0 -7
- package/src/lab/create.autocomplete.simple.tsx +0 -57
- package/src/lab/create.dino-store.ts +0 -59
- package/src/lab/create.multi-select-dropdown.tsx +0 -189
- package/src/lab/create.select-mul-with-api/index.tsx +0 -271
- package/src/lab/create.select-mul-with-api/table-custom.tsx +0 -194
- package/src/lab/create.select-mul-with-api/types.ts +0 -26
- package/src/lab/create.select-mul-with-api/ui.units.tsx +0 -163
- package/src/lab/filter-bar/base.tsx +0 -162
- package/src/lab/filter-bar/create.filter-bar.tsx +0 -190
- package/src/lab/filter-bar/create.filter-menu.tsx +0 -156
- package/src/lab/filter-bar/create.filter-panel.tsx +0 -95
- package/src/lab/filter-bar/create.filtered.tsx +0 -41
- package/src/lab/filter-bar/create.sort-menu.tsx +0 -43
- package/src/lab/filter-bar/demo.tsx +0 -50
- package/src/lab/filter-bar/index.ts +0 -6
- package/src/lab/filter-bar/types.ts +0 -105
- package/src/lab/filter-bar/ui.units.tsx +0 -70
- package/src/lab/grafana-dashboard/configs.ts +0 -43
- package/src/lab/grafana-dashboard/date-time-range/absolute-time-rage.tsx +0 -137
- package/src/lab/grafana-dashboard/date-time-range/helpers.ts +0 -126
- package/src/lab/grafana-dashboard/date-time-range/index.tsx +0 -62
- package/src/lab/grafana-dashboard/date-time-range/menu-wrap.tsx +0 -101
- package/src/lab/grafana-dashboard/date-time-range/quick-ranges.tsx +0 -161
- package/src/lab/grafana-dashboard/date-time-range/types.ts +0 -9
- package/src/lab/grafana-dashboard/date-time-range/units.tsx +0 -18
- package/src/lab/grafana-dashboard/helper.ts +0 -25
- package/src/lab/grafana-dashboard/hooks.tsx +0 -79
- package/src/lab/grafana-dashboard/icons.tsx +0 -67
- package/src/lab/grafana-dashboard/index.tsx +0 -120
- package/src/lab/grafana-dashboard/top-bar.tsx +0 -62
- package/src/lab/grafana-dashboard/top-bar.types.ts +0 -5
- package/src/lab/grafana-dashboard/types.ts +0 -8
- package/src/lab/media-player.core1.tsx +0 -273
- package/src/lab/media-player.muted.tsx +0 -62
- package/src/lab/media-player.units.ts +0 -80
- package/src/lab/table-grid/create.table-grid.tsx +0 -183
- package/src/lab/table-grid/demo.tsx +0 -53
- package/src/lab/table-grid/dino.tsx +0 -8
- package/src/lab/table-grid/helpers.tsx +0 -11
- package/src/lab/table-grid/index.ts +0 -3
- package/src/lab/table-grid/item-actions.tsx +0 -138
- package/src/lab/table-grid/toolbar-pannel.tsx +0 -98
- package/src/lab/table-grid/types.ts +0 -68
- package/src/redux/create.hoc-lazy.tsx +0 -80
- package/src/redux/dino.ts +0 -9
- package/src/redux/index.ts +0 -6
- package/src/redux/types.ts +0 -27
- package/src/redux/ui.error-page.tsx +0 -62
- package/src/redux/ui.units.tsx +0 -41
- package/src/redux/vector-404.webp +0 -0
- package/src/table/context.tsx +0 -16
- package/src/table/create.action-row.tsx +0 -91
- package/src/table/create.status-cell.tsx +0 -51
- package/src/table/create.table.tsx +0 -239
- package/src/table/custom.filter-operators.ts +0 -94
- package/src/table/dino.tsx +0 -120
- package/src/table/helpers.ts +0 -94
- package/src/table/index.ts +0 -13
- package/src/table/model-filter.ts +0 -43
- package/src/table/toolbar-pannel.tsx +0 -106
- package/src/table/types.ts +0 -50
- package/src/table/ui.buttons.tsx +0 -54
- package/src/table/ui.units.tsx +0 -189
- package/src/utils/dayjs-config.ts +0 -13
- package/src/utils/helpers.ts +0 -171
- package/src/utils/index.ts +0 -7
- package/src/utils/json-object.ts +0 -29
- package/src/utils/mfe-events.tsx +0 -34
- package/src/utils/query-param.ts +0 -129
- package/tsconfig.json +0 -20
- /package/dist/{src/redux → redux}/types.js +0 -0
- /package/dist/{src/redux → redux}/vector-404.webp.js +0 -0
- /package/dist/{src/table → table}/model-filter.js +0 -0
- /package/dist/{src/utils → utils}/dayjs-config.js +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { SxProps } from '@mui/material';
|
|
3
|
+
export interface GlobalModalState {
|
|
4
|
+
sx?: SxProps;
|
|
5
|
+
sxWrap?: SxProps;
|
|
6
|
+
/** @default true */
|
|
7
|
+
backdropActivated?: boolean;
|
|
8
|
+
onClose?: (reason?: TModalReason) => void;
|
|
9
|
+
renderContent?: () => React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export type TModalReason = 'backdropClick' | 'escapeKeyDown';
|
|
12
|
+
interface GlobalModalProps {
|
|
13
|
+
}
|
|
14
|
+
export type TShowModal = (value: GlobalModalState) => void;
|
|
15
|
+
export type TCloseModal = (event?: {}, reason?: TModalReason) => void;
|
|
16
|
+
export interface IGlobalModalContext {
|
|
17
|
+
show: TShowModal;
|
|
18
|
+
close: TCloseModal;
|
|
19
|
+
}
|
|
20
|
+
export declare const GlobalModalContext: React.Context<IGlobalModalContext>;
|
|
21
|
+
export interface IMapGlobalModal {
|
|
22
|
+
context: IGlobalModalContext;
|
|
23
|
+
}
|
|
24
|
+
export declare const MapGlobalModalContext: (context: (state: IGlobalModalContext) => React.ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare class GlobalModal extends Component<React.PropsWithChildren<GlobalModalProps>, GlobalModalState> implements IGlobalModalContext {
|
|
26
|
+
constructor(props: any);
|
|
27
|
+
show: TShowModal;
|
|
28
|
+
close: TCloseModal;
|
|
29
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
renderContent: () => React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export default GlobalModal;
|
|
33
|
+
export interface IApiGlobalModalContextProps {
|
|
34
|
+
contextGlobalModal: IGlobalModalContext;
|
|
35
|
+
}
|
|
36
|
+
export declare const withApiGlobalModalContext: <P extends IApiGlobalModalContextProps>(Component: React.ComponentType<P>) => (props: Omit<P, "contextGlobalModal">) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const withApiGlobalModalConsumerContext: <P extends IApiGlobalModalContextProps>(Component: React.ComponentType<P>) => (props: Omit<P, "contextGlobalModal">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as ApiPopover } from './popover';
|
|
2
|
+
export * from './popover';
|
|
3
|
+
export { default as AlertGlobal } from './alert-global';
|
|
4
|
+
export * from './alert-global';
|
|
5
|
+
export { default as DrawerGlobal } from './drawer-global';
|
|
6
|
+
export { default as GlobalModal } from './global-modal';
|
|
7
|
+
export * from './global-modal';
|
|
8
|
+
export { default as PopoverGlobal } from './popover-global';
|
|
9
|
+
export * from './popover-global';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { Component, PropsWithChildren } from 'react';
|
|
2
|
+
import { PopoverProps, PopoverVirtualElement } from '@mui/material';
|
|
3
|
+
export interface PopoverGlobalState {
|
|
4
|
+
anchorEl?: Element | (() => Element) | PopoverVirtualElement | (() => PopoverVirtualElement) | null;
|
|
5
|
+
popoverProps?: Omit<PopoverProps, 'open'>;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type OpenPopover = (value: PopoverGlobalState) => void;
|
|
9
|
+
export type ClosePopover = (reason?: 'backdropClick' | 'escapeKeyDown') => void;
|
|
10
|
+
export interface PopoverGlobalContext {
|
|
11
|
+
open: OpenPopover;
|
|
12
|
+
close: ClosePopover;
|
|
13
|
+
}
|
|
14
|
+
export declare const PopoverGlobalApi: PopoverGlobalContext;
|
|
15
|
+
export declare const PopoverGlobalContext: React.Context<PopoverGlobalContext>;
|
|
16
|
+
export declare const MapPopoverGlobalContext: (context: (state: PopoverGlobalContext) => React.ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
interface IProps extends PropsWithChildren {
|
|
18
|
+
}
|
|
19
|
+
export declare class PopoverGlobalProvider extends Component<IProps, PopoverGlobalState> {
|
|
20
|
+
constructor(props: any);
|
|
21
|
+
componentDidMount(): void;
|
|
22
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
openPopover: OpenPopover;
|
|
24
|
+
timer: any;
|
|
25
|
+
closePopover: ClosePopover;
|
|
26
|
+
}
|
|
27
|
+
export interface IPopoverGlobalContextProps {
|
|
28
|
+
contextPopover: PopoverGlobalContext;
|
|
29
|
+
}
|
|
30
|
+
export declare const withPopoverGlobalContext: <P extends IPopoverGlobalContextProps>(Component: React.ComponentType<P>) => (props: Omit<P, "contextPopover">) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare const PopoverGlobal: {
|
|
32
|
+
Provider: typeof PopoverGlobalProvider;
|
|
33
|
+
Api: PopoverGlobalContext;
|
|
34
|
+
Context: React.Context<PopoverGlobalContext>;
|
|
35
|
+
mapContext: (context: (state: PopoverGlobalContext) => React.ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
};
|
|
37
|
+
export default PopoverGlobal;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { PopoverProps, PopoverVirtualElement } from '@mui/material';
|
|
3
|
+
export interface IPopoverOptions {
|
|
4
|
+
anchorEl?: Element | (() => Element) | PopoverVirtualElement | (() => PopoverVirtualElement) | null;
|
|
5
|
+
popoverProps?: Omit<PopoverProps, 'open'>;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type TShowPopover = (option: IPopoverOptions) => void;
|
|
9
|
+
export type TClosePopover = (reason?: 'backdropClick' | 'escapeKeyDown') => void;
|
|
10
|
+
export interface IApiPopoverContext {
|
|
11
|
+
showPopover: TShowPopover;
|
|
12
|
+
closePopover: TClosePopover;
|
|
13
|
+
}
|
|
14
|
+
export declare const ApiPopoverContext: React.Context<IApiPopoverContext>;
|
|
15
|
+
export declare const MapApiPopoverContext: (context: (state: IApiPopoverContext) => React.ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface IProps {
|
|
17
|
+
}
|
|
18
|
+
interface IState extends IPopoverOptions {
|
|
19
|
+
}
|
|
20
|
+
type TProps = React.PropsWithChildren<IProps>;
|
|
21
|
+
declare class ApiPopover extends Component<TProps, IState> implements IApiPopoverContext {
|
|
22
|
+
constructor(props: any);
|
|
23
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
showPopover: (option: IPopoverOptions) => void;
|
|
25
|
+
timer: any;
|
|
26
|
+
closePopover: TClosePopover;
|
|
27
|
+
}
|
|
28
|
+
export default ApiPopover;
|
|
29
|
+
export interface IApiPopoverContextProps {
|
|
30
|
+
contextPopover: IApiPopoverContext;
|
|
31
|
+
}
|
|
32
|
+
export declare const withApiPopoverContext: <P extends IApiPopoverContextProps>(Component: React.ComponentType<P>) => (props: Omit<P, "contextPopover">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { TypographyProps } from '@mui/material';
|
|
3
|
+
export interface IBreadcrumbConfig {
|
|
4
|
+
label: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
propsGetter?: () => TypographyProps;
|
|
7
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface IBreadcrumbsProps {
|
|
10
|
+
value?: IBreadcrumbConfig[];
|
|
11
|
+
}
|
|
12
|
+
declare const Breadcrumbs: FC<IBreadcrumbsProps>;
|
|
13
|
+
export default Breadcrumbs;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Component, ComponentType } from 'react';
|
|
2
|
+
import { ButtonProps, TooltipProps } from '@mui/material';
|
|
3
|
+
export interface ICopyToClipboardProps {
|
|
4
|
+
value: string;
|
|
5
|
+
slots?: {
|
|
6
|
+
tooltipProps?: Partial<TooltipProps>;
|
|
7
|
+
button?: ComponentType<{
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
copied?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
buttonProps?: ButtonProps;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ICopyToClipboardState {
|
|
15
|
+
showTooltip: boolean;
|
|
16
|
+
copied: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare class CopyToClipboard extends Component<ICopyToClipboardProps, ICopyToClipboardState> {
|
|
19
|
+
constructor(props: ICopyToClipboardProps);
|
|
20
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
renderIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
handleClickCopy: () => void;
|
|
23
|
+
private debounceTime;
|
|
24
|
+
private onCopy;
|
|
25
|
+
}
|
|
26
|
+
export default CopyToClipboard;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface IHelpTooltipProps {
|
|
4
|
+
title: string;
|
|
5
|
+
small?: boolean;
|
|
6
|
+
sxIcon?: SxProps<Theme>;
|
|
7
|
+
}
|
|
8
|
+
declare const HelpTooltip: FC<PropsWithChildren<IHelpTooltipProps>>;
|
|
9
|
+
export default HelpTooltip;
|
|
10
|
+
export interface IHelpTooltipWrapProps {
|
|
11
|
+
content: ReactNode;
|
|
12
|
+
title: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const HelpTooltipWrap: FC<IHelpTooltipWrapProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
export interface IImageWithFallbackPropsOwner {
|
|
3
|
+
src?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
fallbackSrc: string;
|
|
6
|
+
loading?: ReactNode;
|
|
7
|
+
debounceDelay?: number;
|
|
8
|
+
}
|
|
9
|
+
export type IImageProps = Omit<React.ImgHTMLAttributes<HTMLImageElement>, keyof IImageWithFallbackPropsOwner>;
|
|
10
|
+
export interface IImageWithFallbackProps extends IImageProps, IImageWithFallbackPropsOwner {
|
|
11
|
+
}
|
|
12
|
+
declare const ImageWithFallback: FC<IImageWithFallbackProps>;
|
|
13
|
+
export default ImageWithFallback;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as Breadcrumbs } from './breadcrumbs';
|
|
2
|
+
export * from './breadcrumbs';
|
|
3
|
+
export { default as CopyToClipboard } from './copy-to-clipboard';
|
|
4
|
+
export * from './copy-to-clipboard';
|
|
5
|
+
export { default as ImageWithFallback } from './image-with-fallback';
|
|
6
|
+
export * from './image-with-fallback';
|
|
7
|
+
export { default as HelpTooltip } from './help-tooltip';
|
|
8
|
+
export * from './help-tooltip';
|
|
9
|
+
export { default as TextEditorPreview } from './text-editor.preview';
|
|
10
|
+
export { default as TextEditor } from './text-editor';
|
|
11
|
+
export * from './text-editor';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface IInputDebounceTimerProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabledTimer?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const InputDebounceTimer: FC<IInputDebounceTimerProps>;
|
|
9
|
+
export default InputDebounceTimer;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import 'react-quill/dist/quill.snow.css';
|
|
4
|
+
export declare const textEditorClasses: {
|
|
5
|
+
root: string;
|
|
6
|
+
fullscreen: string;
|
|
7
|
+
};
|
|
8
|
+
export interface ITextEditorProps {
|
|
9
|
+
id?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
sx?: SxProps<Theme>;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
defautValue?: string;
|
|
14
|
+
error?: boolean;
|
|
15
|
+
onBlur?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ITextEditorState {
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
declare class TextEditor extends Component<ITextEditorProps, ITextEditorState> {
|
|
21
|
+
constructor(props: ITextEditorProps);
|
|
22
|
+
handleChange: (value: string) => void;
|
|
23
|
+
id: number;
|
|
24
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export default TextEditor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { IFormInputBase } from './types';
|
|
3
|
+
export interface IAutocompleteChipParams {
|
|
4
|
+
optionItems?: string[];
|
|
5
|
+
limitTags?: number;
|
|
6
|
+
separator?: string;
|
|
7
|
+
saveLocalStorageByKey?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IAutocompleteChipProps<T> extends IFormInputBase<T, IAutocompleteChipParams> {
|
|
10
|
+
}
|
|
11
|
+
export interface IAutocompleteChipState {
|
|
12
|
+
value: string[];
|
|
13
|
+
options: string[];
|
|
14
|
+
}
|
|
15
|
+
declare function CreateAutocompleteChip<T>(params?: IAutocompleteChipParams): ComponentType<IAutocompleteChipProps<T>>;
|
|
16
|
+
export default CreateAutocompleteChip;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
import { IFormInputBase } from './types';
|
|
4
|
+
export interface IDateExpiredSlots<T> {
|
|
5
|
+
/** @default string */
|
|
6
|
+
type?: 'number' | 'string';
|
|
7
|
+
textFieldProps?: Partial<TextFieldProps>;
|
|
8
|
+
switchChecked?: boolean;
|
|
9
|
+
switchCheckedGetter?: (value: any, model?: Partial<T>) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface IDateExpiredProps<T> extends IFormInputBase<T> {
|
|
12
|
+
slots?: IDateExpiredSlots<T>;
|
|
13
|
+
}
|
|
14
|
+
export interface IDateExpiredState {
|
|
15
|
+
numberOfDays: number;
|
|
16
|
+
switchChecked: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare function CreateDateExpired<T>(params?: IDateExpiredSlots<T>): React.ComponentType<IDateExpiredProps<T>>;
|
|
19
|
+
export default CreateDateExpired;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
|
+
import { DatePickerProps } from '@mui/x-date-pickers';
|
|
4
|
+
import { IFormInputBase } from './types';
|
|
5
|
+
export interface IDatePickerSlots {
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
minDate?: Dayjs;
|
|
8
|
+
minDateOffset?: number;
|
|
9
|
+
datePickerProps?: DatePickerProps<Dayjs>;
|
|
10
|
+
}
|
|
11
|
+
export interface IDatePickerProps<T> extends IFormInputBase<T> {
|
|
12
|
+
format?: string;
|
|
13
|
+
slots?: Omit<IDatePickerSlots, 'defaultValue'>;
|
|
14
|
+
}
|
|
15
|
+
export interface IDatePickerState {
|
|
16
|
+
value: Dayjs | null;
|
|
17
|
+
}
|
|
18
|
+
declare const CreateDatePicker: <T extends Object>(params?: IDatePickerSlots) => React.ComponentType<IDatePickerProps<T>>;
|
|
19
|
+
export default CreateDatePicker;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { ComponentType, PropsWithChildren } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { IFormBase } from './types';
|
|
4
|
+
import FormValidator, { IPartialError } from './validator';
|
|
5
|
+
export interface FormBaseParam<TModel> {
|
|
6
|
+
validate?: FormValidator<Partial<TModel>>;
|
|
7
|
+
}
|
|
8
|
+
export interface FormBaseProps<TModel> extends PropsWithChildren {
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
validate?: FormValidator<Partial<TModel>>;
|
|
11
|
+
onSubmit: (data: Partial<TModel>, e: React.FormEvent<HTMLFormElement>) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface FormBaseState<TModel> extends Pick<IFormBase<TModel>, 'messageErrors'> {
|
|
14
|
+
modelState?: Partial<TModel>;
|
|
15
|
+
}
|
|
16
|
+
export interface IFormContextBase<TModel> {
|
|
17
|
+
modelState?: Partial<TModel>;
|
|
18
|
+
messageErrors: IPartialError<TModel>;
|
|
19
|
+
onBlur: (keyName: keyof TModel) => void;
|
|
20
|
+
setError: (keyName: keyof TModel, message: string) => void;
|
|
21
|
+
clearErrorAll: (keyName: keyof TModel) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface FormBaseResult<TModel> {
|
|
24
|
+
Form: ComponentType<FormBaseProps<TModel>>;
|
|
25
|
+
Validator?: FormValidator<Partial<TModel>>;
|
|
26
|
+
Context: React.Context<IFormContextBase<TModel>>;
|
|
27
|
+
contextMapping: (params: (context: IFormContextBase<TModel>) => JSX.Element) => JSX.Element;
|
|
28
|
+
}
|
|
29
|
+
declare const CreateFormBase: <TModel>(param?: FormBaseParam<TModel> | undefined) => FormBaseResult<TModel>;
|
|
30
|
+
export default CreateFormBase;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
export interface IFormComfirmParam<T> {
|
|
3
|
+
title?: string;
|
|
4
|
+
content: (value?: T) => JSX.Element;
|
|
5
|
+
colors?: {
|
|
6
|
+
yes?: 'inherit' | 'error' | 'primary' | 'secondary' | 'success' | 'info' | 'warning';
|
|
7
|
+
no?: 'inherit' | 'error' | 'primary' | 'secondary' | 'success' | 'info' | 'warning';
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface IFormComfirmProps<T> {
|
|
11
|
+
data?: T;
|
|
12
|
+
title?: string;
|
|
13
|
+
onSubmit: (value?: T) => Promise<void>;
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface IFormComfirmState {
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const CreateFormComfirm: <T = any>(param?: IFormComfirmParam<T> | undefined) => React.ComponentType<React.PropsWithChildren<IFormComfirmProps<T>>>;
|
|
20
|
+
export default CreateFormComfirm;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { BoxProps, RegularBreakpoints, SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { IFormBase, IFormInputBase } from './types';
|
|
4
|
+
import FormValidator from './validator';
|
|
5
|
+
export interface IFormGridLayoutConfig<T> {
|
|
6
|
+
key: keyof T;
|
|
7
|
+
label?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
reponsives?: RegularBreakpoints;
|
|
10
|
+
defaultValue?: any;
|
|
11
|
+
inputElement?: React.ComponentType<IFormInputBase<T>>;
|
|
12
|
+
}
|
|
13
|
+
export type SubmitMappingEvent<T> = (value: Partial<T>, oldValue?: T) => Partial<T>;
|
|
14
|
+
export interface IFormGridLayoutSlots<T> {
|
|
15
|
+
action?: React.ComponentType<IFormBase<T>>;
|
|
16
|
+
actionBefore?: JSX.Element;
|
|
17
|
+
contentBefore?: JSX.Element;
|
|
18
|
+
contentAfter?: JSX.Element;
|
|
19
|
+
inputVisibility?: Partial<Record<keyof T, boolean>>;
|
|
20
|
+
inputDisabled?: Partial<Record<keyof T, boolean>>;
|
|
21
|
+
closeState?: {
|
|
22
|
+
Success?: boolean;
|
|
23
|
+
Fail?: boolean;
|
|
24
|
+
};
|
|
25
|
+
contentProps?: BoxProps;
|
|
26
|
+
}
|
|
27
|
+
export interface IFormGridLayoutParams<T> extends IFormGridLayoutSlots<T> {
|
|
28
|
+
configs: IFormGridLayoutConfig<T>[];
|
|
29
|
+
validate: FormValidator<Partial<T>>;
|
|
30
|
+
submitMapping?: SubmitMappingEvent<T>;
|
|
31
|
+
}
|
|
32
|
+
export interface IFormGridLayoutProps<T> {
|
|
33
|
+
data?: T;
|
|
34
|
+
onSubmit: (value: Partial<T>, signal?: AbortSignal) => Promise<void>;
|
|
35
|
+
onError?: (error: any) => void;
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
sx?: SxProps<Theme>;
|
|
38
|
+
slots?: IFormGridLayoutSlots<T>;
|
|
39
|
+
}
|
|
40
|
+
export interface IFormGridLayoutState {
|
|
41
|
+
loadding?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare const CreateFormGridLayout: <T>(params: IFormGridLayoutParams<T>) => React.ComponentType<IFormGridLayoutProps<T>>;
|
|
44
|
+
export default CreateFormGridLayout;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { IFormBase } from './types';
|
|
3
|
+
export declare const ContentWrap: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
4
|
+
export interface IFormBottomBarProps<T> extends IFormBase<T> {
|
|
5
|
+
before?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function CreateFormBottomBar<T>(): React.FC<IFormBottomBarProps<T>>;
|
|
8
|
+
export declare const FormBottomBarWrap: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
import { IFormInputBase } from './types';
|
|
4
|
+
import { IImageWithFallbackPropsOwner } from '../components';
|
|
5
|
+
export interface InputBaseImage<T> extends Partial<IImageWithFallbackPropsOwner> {
|
|
6
|
+
srcValue?: (value: any, model?: Partial<T>) => string;
|
|
7
|
+
element?: React.ComponentType<{
|
|
8
|
+
value: any;
|
|
9
|
+
model?: Partial<T>;
|
|
10
|
+
}>;
|
|
11
|
+
mirror?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface IInputSlots<T> {
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
textFieldProps?: TextFieldProps;
|
|
16
|
+
pastenable?: boolean;
|
|
17
|
+
imageLeft?: InputBaseImage<T>;
|
|
18
|
+
imageRight?: InputBaseImage<T>;
|
|
19
|
+
}
|
|
20
|
+
export interface IInputProps<T> extends IFormInputBase<T> {
|
|
21
|
+
slots?: IInputSlots<T>;
|
|
22
|
+
}
|
|
23
|
+
export interface IInputState {
|
|
24
|
+
value?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IInputParams<T> extends IInputSlots<T> {
|
|
27
|
+
}
|
|
28
|
+
declare const CreateInput: <T>(params?: IInputParams<T> | undefined) => React.ComponentType<IInputProps<T>>;
|
|
29
|
+
export default CreateInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
import { IFormInputBase } from './types';
|
|
4
|
+
export interface IInputFileProps<T> extends IFormInputBase<T> {
|
|
5
|
+
accept?: string;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
textFieldProps?: TextFieldProps;
|
|
8
|
+
}
|
|
9
|
+
export interface IInputFileState {
|
|
10
|
+
}
|
|
11
|
+
export interface IInputFileParams {
|
|
12
|
+
accept?: string;
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function CreateInputFile<T>(params?: IInputFileParams): ComponentType<IFormInputBase<T>>;
|
|
16
|
+
export default CreateInputFile;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { SelectProps } from '@mui/material';
|
|
3
|
+
import { IFormInputBase } from './types';
|
|
4
|
+
export interface ISelectSimpleOption<T extends string = string> {
|
|
5
|
+
name: string;
|
|
6
|
+
value: T;
|
|
7
|
+
}
|
|
8
|
+
export interface ISelectSimpleSlots {
|
|
9
|
+
selectProps?: Omit<SelectProps, 'variant'>;
|
|
10
|
+
}
|
|
11
|
+
export interface ISelectSimpleProps<T> extends Partial<IFormInputBase<T>> {
|
|
12
|
+
options?: ISelectSimpleOption[];
|
|
13
|
+
onChange?: (value: ISelectSimpleOption) => void;
|
|
14
|
+
slots?: ISelectSimpleSlots;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ISelectSimpleState {
|
|
18
|
+
value?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ISelectSimpleParams extends ISelectSimpleSlots {
|
|
21
|
+
options?: ISelectSimpleOption[];
|
|
22
|
+
}
|
|
23
|
+
declare function CreateSelectSimple<T>(args?: ISelectSimpleParams): ComponentType<ISelectSimpleProps<T>>;
|
|
24
|
+
export default CreateSelectSimple;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
import { IFormInputBase } from './types';
|
|
4
|
+
export interface ISelectWithApiOption<TOther = any> {
|
|
5
|
+
Id: string;
|
|
6
|
+
Name?: string;
|
|
7
|
+
Other?: TOther;
|
|
8
|
+
}
|
|
9
|
+
export interface ISelectWithApiPropsSlots {
|
|
10
|
+
textFieldProps: TextFieldProps;
|
|
11
|
+
}
|
|
12
|
+
export type ISelectWithApiFetchData<O extends ISelectWithApiOption> = (value?: string, signal?: AbortSignal) => Promise<O[]>;
|
|
13
|
+
export interface ISelectWithApiProps<T, O extends ISelectWithApiOption> extends IFormInputBase<T>, ISelectWithApiParams<O> {
|
|
14
|
+
onChange?: (value: O | null) => void;
|
|
15
|
+
existedIds?: string[];
|
|
16
|
+
slots?: ISelectWithApiPropsSlots;
|
|
17
|
+
}
|
|
18
|
+
export interface ISelectWithApiState<O extends ISelectWithApiOption> {
|
|
19
|
+
options: O[];
|
|
20
|
+
statusText?: string;
|
|
21
|
+
optionSelected: O | null;
|
|
22
|
+
inputValue: string;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ISelectWithApiParams<O extends ISelectWithApiOption> {
|
|
26
|
+
fetchData?: ISelectWithApiFetchData<O>;
|
|
27
|
+
}
|
|
28
|
+
declare const CreateSelectWithApi: <T, O extends ISelectWithApiOption<any> = ISelectWithApiOption<any>>(params?: ISelectWithApiParams<O> | undefined) => React.ComponentType<ISelectWithApiProps<T, O>>;
|
|
29
|
+
export default CreateSelectWithApi;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IFormInputBase } from './types';
|
|
3
|
+
export interface ITextEditorParams {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ITextEditorProps<T> extends IFormInputBase<T> {
|
|
8
|
+
}
|
|
9
|
+
export interface ITextEditorState {
|
|
10
|
+
isFullscreen: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function CreateTextEditor<T>(params: ITextEditorParams): {
|
|
13
|
+
new (props: ITextEditorProps<T>): {
|
|
14
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
componentWillUnmount(): void;
|
|
17
|
+
handleFullscreenChange: () => void;
|
|
18
|
+
handleFullscreenToggle: () => void;
|
|
19
|
+
getWrapClasses: () => string;
|
|
20
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
context: unknown;
|
|
22
|
+
setState<K extends "isFullscreen">(state: ITextEditorState | ((prevState: Readonly<ITextEditorState>, props: Readonly<ITextEditorProps<T>>) => ITextEditorState | Pick<ITextEditorState, K> | null) | Pick<ITextEditorState, K> | null, callback?: (() => void) | undefined): void;
|
|
23
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
24
|
+
readonly props: Readonly<ITextEditorProps<T>>;
|
|
25
|
+
state: Readonly<ITextEditorState>;
|
|
26
|
+
refs: {
|
|
27
|
+
[key: string]: React.ReactInstance;
|
|
28
|
+
};
|
|
29
|
+
shouldComponentUpdate?(nextProps: Readonly<ITextEditorProps<T>>, nextState: Readonly<ITextEditorState>, nextContext: any): boolean;
|
|
30
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
31
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<ITextEditorProps<T>>, prevState: Readonly<ITextEditorState>): any;
|
|
32
|
+
componentDidUpdate?(prevProps: Readonly<ITextEditorProps<T>>, prevState: Readonly<ITextEditorState>, snapshot?: any): void;
|
|
33
|
+
componentWillMount?(): void;
|
|
34
|
+
UNSAFE_componentWillMount?(): void;
|
|
35
|
+
componentWillReceiveProps?(nextProps: Readonly<ITextEditorProps<T>>, nextContext: any): void;
|
|
36
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ITextEditorProps<T>>, nextContext: any): void;
|
|
37
|
+
componentWillUpdate?(nextProps: Readonly<ITextEditorProps<T>>, nextState: Readonly<ITextEditorState>, nextContext: any): void;
|
|
38
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<ITextEditorProps<T>>, nextState: Readonly<ITextEditorState>, nextContext: any): void;
|
|
39
|
+
};
|
|
40
|
+
contextType?: React.Context<any> | undefined;
|
|
41
|
+
};
|
|
42
|
+
export default CreateTextEditor;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import FormValidator from './validator';
|
|
3
|
+
import CreateInputFile from './create.input.file';
|
|
4
|
+
import CreateTextEditor from './create.text-editor';
|
|
5
|
+
import CreateDateExpired from './create.date-expired';
|
|
6
|
+
import CreateSelectSimple from './create.select-simple';
|
|
7
|
+
import CreateAutocompleteChip from './create.autocomplete.chips';
|
|
8
|
+
declare class DinoFormBase {
|
|
9
|
+
ModalWrap: import("react").FC<import("./modal-wrapper").IFormModalWrapperProps>;
|
|
10
|
+
BottomBarWrap: StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
11
|
+
FormValidator: typeof FormValidator;
|
|
12
|
+
validator: <T>(configs: import("./validator").IFormValidatorConfig<T>) => FormValidator<T>;
|
|
13
|
+
createFormBase: <TModel>(param?: import("./create.form-base").FormBaseParam<TModel> | undefined) => import("./create.form-base").FormBaseResult<TModel>;
|
|
14
|
+
createFormComfirm: <T = any>(param?: import("./create.form-comfirm").IFormComfirmParam<T> | undefined) => import("react").ComponentType<import("react").PropsWithChildren<import("./create.form-comfirm").IFormComfirmProps<T>>>;
|
|
15
|
+
createFormGridLayout: <T>(params: import("./create.form-grid-layout").IFormGridLayoutParams<T>) => import("react").ComponentType<import("./create.form-grid-layout").IFormGridLayoutProps<T>>;
|
|
16
|
+
createDateExpired: typeof CreateDateExpired;
|
|
17
|
+
createDatePicker: <T extends Object>(params?: import("./create.date-picker").IDatePickerSlots | undefined) => import("react").ComponentType<import("./create.date-picker").IDatePickerProps<T>>;
|
|
18
|
+
createAutocompleteChip: typeof CreateAutocompleteChip;
|
|
19
|
+
createInput: <T>(params?: import("./create.input").IInputParams<T> | undefined) => import("react").ComponentType<import("./create.input").IInputProps<T>>;
|
|
20
|
+
createInputFile: typeof CreateInputFile;
|
|
21
|
+
createSelectSimple: typeof CreateSelectSimple;
|
|
22
|
+
createSelectWithApi: <T, O extends import("./create.select-with-api").ISelectWithApiOption<any> = import("./create.select-with-api").ISelectWithApiOption<any>>(params?: import("./create.select-with-api").ISelectWithApiParams<O> | undefined) => import("react").ComponentType<import("./create.select-with-api").ISelectWithApiProps<T, O>>;
|
|
23
|
+
createTextEditor: typeof CreateTextEditor;
|
|
24
|
+
}
|
|
25
|
+
declare const DinoForm: DinoFormBase;
|
|
26
|
+
export default DinoForm;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
import FormValidator, { IModelError, IPartialError } from './validator';
|
|
3
|
+
export declare const getErrorMessage: <TModel>(MessageErrors: IPartialError<TModel> | undefined, key?: keyof TModel | undefined) => IModelError;
|
|
4
|
+
type IModelBase = {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const convertFormDataToJson: <TModel>(form: FormData) => Partial<TModel>;
|
|
8
|
+
export declare const SingleValidate: <TModel, TPartial = TModel>(key: keyof TModel, modelState: TPartial, MessageErrors: IPartialError<TModel>, Validator: FormValidator<TPartial>) => {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
} | null;
|
|
11
|
+
export declare const getErrorFromResponse: <TModel>(error: AxiosError, ModelRender: TModel) => IPartialError<TModel> | undefined;
|
|
12
|
+
export declare const clearFieldEmpty: <TModel>(model: Extract<TModel, IModelBase>) => void;
|
|
13
|
+
export declare const validateMerge: <TModel>(...validateor: (FormValidator<TModel> | undefined)[]) => FormValidator<TModel>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { default as FormValidator } from './validator';
|
|
3
|
+
export * from './validator';
|
|
4
|
+
export { default as DinoForm } from './dino-form';
|
|
5
|
+
export { getErrorMessage, convertFormDataToJson } from './helper';
|
|
6
|
+
export type { ISelectWithApiOption } from './create.select-with-api';
|
|
7
|
+
export type { InputBaseImage } from './create.input';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { Breakpoint, SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface IFormModalWrapperProps extends PropsWithChildren {
|
|
4
|
+
title: string;
|
|
5
|
+
size?: Breakpoint;
|
|
6
|
+
fullHeight?: boolean;
|
|
7
|
+
onCloseClick?: () => void;
|
|
8
|
+
slots?: {
|
|
9
|
+
sxTopbarProps?: SxProps<Theme>;
|
|
10
|
+
beforeTitle?: JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const FormModalWrapper: FC<IFormModalWrapperProps>;
|
|
14
|
+
export default FormModalWrapper;
|