mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-24 07:17:55 +01:00
feat: ✨ Major refactor componente DataTable
- Aggiunto supporto per le tabelle "checkable" (tabelle con le checkbox) - Migliorata la gestione generale della tabella, rendendola meno complicata da creare
This commit is contained in:
parent
e5d04fbf17
commit
7acaf6ed38
3
.idea/inspectionProfiles/Project_Default.xml
generated
3
.idea/inspectionProfiles/Project_Default.xml
generated
@ -99,7 +99,7 @@
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="21">
|
||||
<list size="22">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
@ -121,6 +121,7 @@
|
||||
<item index="18" class="java.lang.String" itemvalue="text-field" />
|
||||
<item index="19" class="java.lang.String" itemvalue="text-area" />
|
||||
<item index="20" class="java.lang.String" itemvalue="mwc-select" />
|
||||
<item index="21" class="java.lang.String" itemvalue="mwc-checkbox" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
|
10
package.json
10
package.json
@ -18,8 +18,8 @@
|
||||
"@inertiajs/inertia": "^0.10.1",
|
||||
"@inertiajs/progress": "^0.2.6",
|
||||
"@maicol07/inertia-mithril": "^0.4.0",
|
||||
"@maicol07/mwc-card": "^0.25.1",
|
||||
"@maicol07/mwc-layout-grid": "^0.25.1",
|
||||
"@maicol07/mwc-card": "^0.25.2",
|
||||
"@maicol07/mwc-layout-grid": "^0.25.3",
|
||||
"@material/card": "^13.0.0",
|
||||
"@material/data-table": "^13.0.0",
|
||||
"@material/layout-grid": "^13.0.0",
|
||||
@ -67,8 +67,8 @@
|
||||
"@babel/plugin-proposal-throw-expressions": "^7.16.0",
|
||||
"@babel/plugin-syntax-flow": "^7.16.0",
|
||||
"@babel/plugin-transform-react-jsx": "^7.16.0",
|
||||
"@babel/plugin-transform-runtime": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"@babel/plugin-transform-runtime": "^7.16.4",
|
||||
"@babel/preset-env": "^7.16.4",
|
||||
"@babel/preset-react": "^7.16.0",
|
||||
"@bunchtogether/vite-plugin-flow": "^1.0.1",
|
||||
"@open-wc/eslint-config": "^7.0.0",
|
||||
@ -80,7 +80,7 @@
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-flowtype": "^8.0.3",
|
||||
"eslint-plugin-github": "^4.3.4",
|
||||
"eslint-plugin-github": "^4.3.5",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-mithril": "^0.2.0",
|
||||
"eslint-plugin-new-with-error": "^2.0.0",
|
||||
|
119
pnpm-lock.yaml
generated
119
pnpm-lock.yaml
generated
@ -9,15 +9,15 @@ specifiers:
|
||||
'@babel/plugin-proposal-throw-expressions': ^7.16.0
|
||||
'@babel/plugin-syntax-flow': ^7.16.0
|
||||
'@babel/plugin-transform-react-jsx': ^7.16.0
|
||||
'@babel/plugin-transform-runtime': ^7.16.0
|
||||
'@babel/preset-env': ^7.16.0
|
||||
'@babel/plugin-transform-runtime': ^7.16.4
|
||||
'@babel/preset-env': ^7.16.4
|
||||
'@babel/preset-react': ^7.16.0
|
||||
'@bunchtogether/vite-plugin-flow': ^1.0.1
|
||||
'@inertiajs/inertia': ^0.10.1
|
||||
'@inertiajs/progress': ^0.2.6
|
||||
'@maicol07/inertia-mithril': ^0.4.0
|
||||
'@maicol07/mwc-card': ^0.25.1
|
||||
'@maicol07/mwc-layout-grid': ^0.25.1
|
||||
'@maicol07/mwc-card': ^0.25.2
|
||||
'@maicol07/mwc-layout-grid': ^0.25.3
|
||||
'@material/card': ^13.0.0
|
||||
'@material/data-table': ^13.0.0
|
||||
'@material/layout-grid': ^13.0.0
|
||||
@ -55,7 +55,7 @@ specifiers:
|
||||
eslint: ^7.32.0
|
||||
eslint-config-airbnb-base: ^15.0.0
|
||||
eslint-plugin-flowtype: ^8.0.3
|
||||
eslint-plugin-github: ^4.3.4
|
||||
eslint-plugin-github: ^4.3.5
|
||||
eslint-plugin-import: ^2.25.3
|
||||
eslint-plugin-mithril: ^0.2.0
|
||||
eslint-plugin-new-with-error: ^2.0.0
|
||||
@ -96,8 +96,8 @@ dependencies:
|
||||
'@inertiajs/inertia': 0.10.1
|
||||
'@inertiajs/progress': 0.2.6_@inertiajs+inertia@0.10.1
|
||||
'@maicol07/inertia-mithril': 0.4.0_mithril@2.0.4
|
||||
'@maicol07/mwc-card': 0.25.1
|
||||
'@maicol07/mwc-layout-grid': 0.25.1
|
||||
'@maicol07/mwc-card': 0.25.2
|
||||
'@maicol07/mwc-layout-grid': 0.25.3
|
||||
'@material/card': 13.0.0
|
||||
'@material/data-table': 13.0.0
|
||||
'@material/layout-grid': 13.0.0
|
||||
@ -145,12 +145,12 @@ devDependencies:
|
||||
'@babel/plugin-proposal-throw-expressions': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-syntax-flow': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-transform-react-jsx': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-transform-runtime': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/preset-env': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-transform-runtime': 7.16.4_@babel+core@7.16.0
|
||||
'@babel/preset-env': 7.16.4_@babel+core@7.16.0
|
||||
'@babel/preset-react': 7.16.0_@babel+core@7.16.0
|
||||
'@bunchtogether/vite-plugin-flow': 1.0.1
|
||||
'@open-wc/eslint-config': 7.0.0_@babel+eslint-plugin@7.14.5
|
||||
'@openstamanager/eslint-config': github.com/maicol07/eslint-config-openstamanager/1eafa549ce83e3ea90686924f9e535b4ace0503a_69ae26fb606779a6dbe9d70fa2a4e211
|
||||
'@openstamanager/eslint-config': github.com/maicol07/eslint-config-openstamanager/1eafa549ce83e3ea90686924f9e535b4ace0503a_d58bb2a62a629571987852e16e33e6de
|
||||
'@openstamanager/vite-config': github.com/maicol07/openstamanager-vite-config/d8ac3e7c1dec6545e66ffc30f2bde9841890bae5_d97a2efaa2b85460d32e373b064b7335
|
||||
'@types/ziggy-js': 1.3.0
|
||||
babel-plugin-transform-flow-enums: 0.0.2_@babel+core@7.16.0
|
||||
@ -158,7 +158,7 @@ devDependencies:
|
||||
eslint: 7.32.0
|
||||
eslint-config-airbnb-base: 15.0.0_a820dc868cc8cd66d8297be6779b9035
|
||||
eslint-plugin-flowtype: 8.0.3_f352da6f9c36c27d4e75da053be5baab
|
||||
eslint-plugin-github: 4.3.4_eslint@7.32.0+typescript@4.4.4
|
||||
eslint-plugin-github: 4.3.5_eslint@7.32.0+typescript@4.4.4
|
||||
eslint-plugin-import: 2.25.3_eslint@7.32.0
|
||||
eslint-plugin-mithril: 0.2.0
|
||||
eslint-plugin-new-with-error: 2.0.0_eslint@7.32.0
|
||||
@ -196,8 +196,8 @@ packages:
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/plugin-proposal-throw-expressions': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-transform-flow-strip-types': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-transform-runtime': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/preset-env': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-transform-runtime': 7.16.4_@babel+core@7.16.0
|
||||
'@babel/preset-env': 7.16.4_@babel+core@7.16.0
|
||||
'@babel/preset-react': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/runtime': 7.16.3
|
||||
babel-plugin-transform-flow-enums: 0.0.2_@babel+core@7.16.0
|
||||
@ -259,6 +259,11 @@ packages:
|
||||
engines: {node: '>=6.9.0'}
|
||||
dev: true
|
||||
|
||||
/@babel/compat-data/7.16.4:
|
||||
resolution: {integrity: sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dev: true
|
||||
|
||||
/@babel/core/7.16.0:
|
||||
resolution: {integrity: sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@ -373,8 +378,8 @@ packages:
|
||||
regexpu-core: 4.8.0
|
||||
dev: true
|
||||
|
||||
/@babel/helper-define-polyfill-provider/0.2.4_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ==}
|
||||
/@babel/helper-define-polyfill-provider/0.3.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.4.0-0
|
||||
dependencies:
|
||||
@ -463,8 +468,8 @@ packages:
|
||||
engines: {node: '>=6.9.0'}
|
||||
dev: true
|
||||
|
||||
/@babel/helper-remap-async-to-generator/7.16.0:
|
||||
resolution: {integrity: sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew==}
|
||||
/@babel/helper-remap-async-to-generator/7.16.4:
|
||||
resolution: {integrity: sha512-vGERmmhR+s7eH5Y/cp8PCVzj4XEjerq8jooMfxFdA5xVtAk9Sh4AQsrWgiErUEBjtGrBtOFKDUcWQFW4/dFwMA==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
dependencies:
|
||||
'@babel/helper-annotate-as-pure': 7.16.0
|
||||
@ -577,15 +582,15 @@ packages:
|
||||
'@babel/plugin-proposal-optional-chaining': 7.16.0_@babel+core@7.16.0
|
||||
dev: true
|
||||
|
||||
/@babel/plugin-proposal-async-generator-functions/7.16.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw==}
|
||||
/@babel/plugin-proposal-async-generator-functions/7.16.4_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-/CUekqaAaZCQHleSK/9HajvcD/zdnJiKRiuUFq8ITE+0HsPzquf53cpFiqAwl/UfmJbR6n5uGPQSPdrmKOvHHg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
dependencies:
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
'@babel/helper-remap-async-to-generator': 7.16.0
|
||||
'@babel/helper-remap-async-to-generator': 7.16.4
|
||||
'@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.16.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@ -690,7 +695,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
dependencies:
|
||||
'@babel/compat-data': 7.16.0
|
||||
'@babel/compat-data': 7.16.4
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-compilation-targets': 7.16.3_@babel+core@7.16.0
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
@ -949,7 +954,7 @@ packages:
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-module-imports': 7.16.0
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
'@babel/helper-remap-async-to-generator': 7.16.0
|
||||
'@babel/helper-remap-async-to-generator': 7.16.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
@ -1272,8 +1277,8 @@ packages:
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
dev: true
|
||||
|
||||
/@babel/plugin-transform-runtime/7.16.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-zlPf1/XFn5+vWdve3AAhf+Sxl+MVa5VlwTwWgnLx23u4GlatSRQJ3Eoo9vllf0a9il3woQsT4SK+5Z7c06h8ag==}
|
||||
/@babel/plugin-transform-runtime/7.16.4_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-pru6+yHANMTukMtEZGC4fs7XPwg35v8sj5CIEmE+gEkFljFiVJxEWxx/7ZDkTK+iZRYo1bFXBtfIN95+K3cJ5A==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
@ -1281,9 +1286,9 @@ packages:
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-module-imports': 7.16.0
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
babel-plugin-polyfill-corejs2: 0.2.3_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-corejs3: 0.3.0_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-regenerator: 0.2.3_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-corejs2: 0.3.0_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-corejs3: 0.4.0_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-regenerator: 0.3.0_@babel+core@7.16.0
|
||||
semver: 6.3.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
@ -1361,20 +1366,20 @@ packages:
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
dev: true
|
||||
|
||||
/@babel/preset-env/7.16.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg==}
|
||||
/@babel/preset-env/7.16.4_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-v0QtNd81v/xKj4gNKeuAerQ/azeNn/G1B1qMLeXOcV8+4TWlD2j3NV1u8q29SDFBXx/NBq5kyEAO+0mpRgacjA==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
dependencies:
|
||||
'@babel/compat-data': 7.16.0
|
||||
'@babel/compat-data': 7.16.4
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-compilation-targets': 7.16.3_@babel+core@7.16.0
|
||||
'@babel/helper-plugin-utils': 7.14.5
|
||||
'@babel/helper-validator-option': 7.14.5
|
||||
'@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.16.2_@babel+core@7.16.0
|
||||
'@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-proposal-async-generator-functions': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-proposal-async-generator-functions': 7.16.4_@babel+core@7.16.0
|
||||
'@babel/plugin-proposal-class-properties': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-proposal-class-static-block': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/plugin-proposal-dynamic-import': 7.16.0_@babel+core@7.16.0
|
||||
@ -1437,9 +1442,9 @@ packages:
|
||||
'@babel/plugin-transform-unicode-regex': 7.16.0_@babel+core@7.16.0
|
||||
'@babel/preset-modules': 0.1.5_@babel+core@7.16.0
|
||||
'@babel/types': 7.16.0
|
||||
babel-plugin-polyfill-corejs2: 0.2.3_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-corejs3: 0.3.0_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-regenerator: 0.2.3_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-corejs2: 0.3.0_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-corejs3: 0.4.0_@babel+core@7.16.0
|
||||
babel-plugin-polyfill-regenerator: 0.3.0_@babel+core@7.16.0
|
||||
core-js-compat: 3.19.1
|
||||
semver: 6.3.0
|
||||
transitivePeerDependencies:
|
||||
@ -1600,8 +1605,8 @@ packages:
|
||||
- debug
|
||||
dev: false
|
||||
|
||||
/@maicol07/mwc-card/0.25.1:
|
||||
resolution: {integrity: sha512-lEQelzOc4Sp3RAMotNADOarE1zrlHdLrmQKzCT/qsAqGUfSuvqUfxYvib0o+kHrvo8vmzBsEIICdWCEeY5HQeQ==}
|
||||
/@maicol07/mwc-card/0.25.2:
|
||||
resolution: {integrity: sha512-5e7DOc/2FpUnmNErs5QqXefdChnnSWzloxxrB69sDQn4+1ggFJ3IOXhsEXttRdiV+Q8kf4Mlpcm4rBbjw6lmcw==}
|
||||
dependencies:
|
||||
'@material/animation': 13.0.0
|
||||
'@material/base': 13.0.0
|
||||
@ -1619,8 +1624,8 @@ packages:
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/@maicol07/mwc-layout-grid/0.25.1:
|
||||
resolution: {integrity: sha512-qDCKTzbOGeVH71AITz0MFDX62YwBtFcbQO5FV5E0WmhGl93a8sJ0hQSsUlV7Yy7QpRPO9ZXFX+5iu4zdZ+N4yA==}
|
||||
/@maicol07/mwc-layout-grid/0.25.3:
|
||||
resolution: {integrity: sha512-Z+lpxxi9IpzH+UxJhFsLb6q8FHaxHxvSV0bcbu8e3NviMhN6Fs1SgNfa/N/85CoWDdB3sFmKJ9EP30A9TS4hag==}
|
||||
dependencies:
|
||||
'@material/layout-grid': 13.0.0
|
||||
'@material/mwc-base': 0.25.3
|
||||
@ -2886,38 +2891,38 @@ packages:
|
||||
object.assign: 4.1.2
|
||||
dev: true
|
||||
|
||||
/babel-plugin-polyfill-corejs2/0.2.3_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA==}
|
||||
/babel-plugin-polyfill-corejs2/0.3.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA==}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
dependencies:
|
||||
'@babel/compat-data': 7.16.0
|
||||
'@babel/compat-data': 7.16.4
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-define-polyfill-provider': 0.2.4_@babel+core@7.16.0
|
||||
'@babel/helper-define-polyfill-provider': 0.3.0_@babel+core@7.16.0
|
||||
semver: 6.3.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/babel-plugin-polyfill-corejs3/0.3.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg==}
|
||||
/babel-plugin-polyfill-corejs3/0.4.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw==}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
dependencies:
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-define-polyfill-provider': 0.2.4_@babel+core@7.16.0
|
||||
'@babel/helper-define-polyfill-provider': 0.3.0_@babel+core@7.16.0
|
||||
core-js-compat: 3.19.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/babel-plugin-polyfill-regenerator/0.2.3_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g==}
|
||||
/babel-plugin-polyfill-regenerator/0.3.0_@babel+core@7.16.0:
|
||||
resolution: {integrity: sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg==}
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
dependencies:
|
||||
'@babel/core': 7.16.0
|
||||
'@babel/helper-define-polyfill-provider': 0.2.4_@babel+core@7.16.0
|
||||
'@babel/helper-define-polyfill-provider': 0.3.0_@babel+core@7.16.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
@ -3639,6 +3644,15 @@ packages:
|
||||
regexpp: 3.2.0
|
||||
dev: true
|
||||
|
||||
/eslint-plugin-escompat/3.1.0_eslint@7.32.0:
|
||||
resolution: {integrity: sha512-Fon3eRv8fOQPZTjT3h8Ga85Xx7Eg+CNZBL7OIYSM2f+p3W4oXTxiSnFUbNDrayRBK3CQjG2dwR+iYeKDDSkXyA==}
|
||||
peerDependencies:
|
||||
eslint: '>=5.14.1'
|
||||
dependencies:
|
||||
browserslist: 4.18.1
|
||||
eslint: 7.32.0
|
||||
dev: true
|
||||
|
||||
/eslint-plugin-eslint-comments/3.2.0_eslint@7.32.0:
|
||||
resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==}
|
||||
engines: {node: '>=6.5.0'}
|
||||
@ -3697,8 +3711,8 @@ packages:
|
||||
string-natural-compare: 3.0.1
|
||||
dev: true
|
||||
|
||||
/eslint-plugin-github/4.3.4_eslint@7.32.0+typescript@4.4.4:
|
||||
resolution: {integrity: sha512-4zpvS5x/YHmG+Ash8tNU6ZKW7YVC9wWA83pt47jcLjtL9F7xiN0QbhEyW63zZvmUlNY5shGaf8yNm9tBHPa6/w==}
|
||||
/eslint-plugin-github/4.3.5_eslint@7.32.0+typescript@4.4.4:
|
||||
resolution: {integrity: sha512-3OPCn/kkFcTq1aYgJJVKzqzmcOn432eaup79TQ5mpWA11JXgF/KvVmIS1RF6har/gMueINMq1P5wDEFS6YQ/Pw==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
eslint: ^8.0.1
|
||||
@ -3707,6 +3721,7 @@ packages:
|
||||
'@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.4
|
||||
eslint: 7.32.0
|
||||
eslint-config-prettier: 8.3.0_eslint@7.32.0
|
||||
eslint-plugin-escompat: 3.1.0_eslint@7.32.0
|
||||
eslint-plugin-eslint-comments: 3.2.0_eslint@7.32.0
|
||||
eslint-plugin-filenames: 1.3.2_eslint@7.32.0
|
||||
eslint-plugin-i18n-text: 1.0.1_eslint@7.32.0
|
||||
@ -6503,7 +6518,7 @@ packages:
|
||||
yargs-parser: 20.2.9
|
||||
dev: true
|
||||
|
||||
github.com/maicol07/eslint-config-openstamanager/1eafa549ce83e3ea90686924f9e535b4ace0503a_69ae26fb606779a6dbe9d70fa2a4e211:
|
||||
github.com/maicol07/eslint-config-openstamanager/1eafa549ce83e3ea90686924f9e535b4ace0503a_d58bb2a62a629571987852e16e33e6de:
|
||||
resolution: {tarball: https://codeload.github.com/maicol07/eslint-config-openstamanager/tar.gz/1eafa549ce83e3ea90686924f9e535b4ace0503a}
|
||||
id: github.com/maicol07/eslint-config-openstamanager/1eafa549ce83e3ea90686924f9e535b4ace0503a
|
||||
name: '@maicol07/eslint-config'
|
||||
@ -6532,7 +6547,7 @@ packages:
|
||||
eslint: 7.32.0
|
||||
eslint-config-airbnb-base: 15.0.0_a820dc868cc8cd66d8297be6779b9035
|
||||
eslint-plugin-flowtype: 8.0.3_f352da6f9c36c27d4e75da053be5baab
|
||||
eslint-plugin-github: 4.3.4_eslint@7.32.0+typescript@4.4.4
|
||||
eslint-plugin-github: 4.3.5_eslint@7.32.0+typescript@4.4.4
|
||||
eslint-plugin-mithril: 0.2.0
|
||||
eslint-plugin-new-with-error: 2.0.0_eslint@7.32.0
|
||||
eslint-plugin-no-secrets: 0.8.9_eslint@7.32.0
|
||||
|
@ -2,22 +2,44 @@ import '@material/mwc-linear-progress';
|
||||
import '@material/mwc-list/mwc-list-item';
|
||||
import '@material/mwc-select';
|
||||
|
||||
import {
|
||||
type Children,
|
||||
type Vnode
|
||||
} from 'mithril';
|
||||
|
||||
import Component from '../Component.jsx';
|
||||
import Mdi from '../Mdi.jsx';
|
||||
import TableColumn from './TableColumn.jsx';
|
||||
import TableFooter from './TableFooter.jsx';
|
||||
import TableRow from './TableRow.jsx';
|
||||
|
||||
export default class DataTable extends Component {
|
||||
view(vnode) {
|
||||
return <div className="mdc-data-table" {...this.attrs.all()}>
|
||||
<div className="mdc-data-table__table-container">
|
||||
<table className="mdc-data-table__table" aria-label={vnode.attrs['aria-label']}>
|
||||
{vnode.children}
|
||||
<table className="mdc-data-table__table" aria-label={this.attrs.get('aria-label')}>
|
||||
<thead>
|
||||
<tr className="mdc-data-table__header-row">
|
||||
{this.attrs.has('checkable')
|
||||
&& <TableColumn type="checkbox">
|
||||
<mwc-checkbox/>
|
||||
</TableColumn>}
|
||||
{this.tableColumns(vnode.children)}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{this.tableRows(vnode.children)}
|
||||
</tbody>
|
||||
|
||||
{this.tableFooter(vnode.children)}
|
||||
</table>
|
||||
|
||||
{this.attrs.has('paginated') ? <div className="mdc-data-table__pagination">
|
||||
{this.attrs.has('paginated') && <div className="mdc-data-table__pagination">
|
||||
<div className="mdc-data-table__pagination-trailing">
|
||||
<div className="mdc-data-table__pagination-rows-per-page">
|
||||
<div className="mdc-data-table__pagination-rows-per-page-label">
|
||||
Righe per pagina
|
||||
{__('Righe per pagina')}
|
||||
</div>
|
||||
|
||||
<mwc-select className="mdc-data-table__pagination-rows-per-page-select">
|
||||
@ -33,8 +55,7 @@ export default class DataTable extends Component {
|
||||
|
||||
<div className="mdc-data-table__pagination-navigation">
|
||||
<div className="mdc-data-table__pagination-total">
|
||||
{/* TODO: Aggiungere i18n */}
|
||||
1‑10 di 100
|
||||
{__('1-:chunk di :total', {chunk: <span id="chunk">10</span>, total: <span id="total">100</span>})}
|
||||
</div>
|
||||
<mwc-icon-button className="mdc-data-table__pagination-button" data-page="first" disabled>
|
||||
<Mdi icon="page_first"/>
|
||||
@ -50,7 +71,7 @@ export default class DataTable extends Component {
|
||||
</mwc-icon-button>
|
||||
</div>
|
||||
</div>
|
||||
</div> : ''}
|
||||
</div>}
|
||||
|
||||
<div className="mdc-data-table__progress-indicator">
|
||||
<div className="mdc-data-table__scrim"/>
|
||||
@ -59,4 +80,38 @@ export default class DataTable extends Component {
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
tableColumns(children: Array<Children>) {
|
||||
return this.filterElements(children.flat(), TableColumn);
|
||||
}
|
||||
|
||||
tableRows(children: Array<Children>) {
|
||||
let rows = this.filterElements(children.flat(), TableRow);
|
||||
|
||||
if (this.attrs.has('checkable')) {
|
||||
rows = rows.map((row: Vnode) => (
|
||||
<TableRow key={row.attrs.key} checkable {...row.attrs}>
|
||||
{row.children}
|
||||
</TableRow>
|
||||
));
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
tableFooter(children: Array<Children>) {
|
||||
return this.filterElements(children.flat(), TableFooter);
|
||||
}
|
||||
|
||||
filterElements(elements: Array<Children>, tag: Component | string): Array<Children> {
|
||||
const filtered = [];
|
||||
|
||||
for (const element: Vnode of elements) {
|
||||
if (element.tag === tag) {
|
||||
filtered.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
return filtered;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
import Component from '../Component.jsx';
|
||||
|
||||
export default class TableBody extends Component {
|
||||
view(vnode) {
|
||||
return <tbody {...this.attrs.all()}>{vnode.children}</tbody>;
|
||||
}
|
||||
}
|
@ -6,7 +6,14 @@ import Component from '../Component.jsx';
|
||||
*/
|
||||
export default class TableCell extends Component {
|
||||
view(vnode) {
|
||||
this.attrs.addClassNames('mdc-data-table__cell', `mdc-data-table__cell--${this.attrs.get('type')}`);
|
||||
this.attrs.addClassNames('mdc-data-table__cell', {
|
||||
[`mdc-data-table__cell--${this.attrs.get('type')}`]: this.attrs.has('type')
|
||||
});
|
||||
|
||||
if ((!vnode.children || vnode.children.length === 0) && this.attrs.get('type') === 'checkbox') {
|
||||
vnode.children = <mwc-checkbox/>;
|
||||
}
|
||||
|
||||
return <td {...this.attrs.all()}>{vnode.children}</td>;
|
||||
}
|
||||
}
|
||||
|
36
resources/js/Components/DataTable/TableColumn.jsx
Normal file
36
resources/js/Components/DataTable/TableColumn.jsx
Normal file
@ -0,0 +1,36 @@
|
||||
import Component from '../Component.jsx';
|
||||
|
||||
/**
|
||||
* Attributes:
|
||||
* - type?: numeric, checkbox
|
||||
*/
|
||||
export default class TableColumn extends Component {
|
||||
view(vnode) {
|
||||
this.attrs.addClassNames('mdc-data-table__header-cell', {
|
||||
[`mdc-data-table__header-cell--${this.attrs.get('type')}`]: this.attrs.has('type')
|
||||
});
|
||||
|
||||
if ((!vnode.children || vnode.children.length === 0) && this.attrs.get('type') === 'checkbox') {
|
||||
vnode.children = <mwc-checkbox/>;
|
||||
}
|
||||
|
||||
return <th {...this.attrs.all()} role="columnheader" scope="col">{vnode.children}</th>;
|
||||
}
|
||||
|
||||
oncreate(vnode) {
|
||||
super.oncreate(vnode);
|
||||
|
||||
if (this.attrs.get('type') === 'checkbox') {
|
||||
window.vnode = $(vnode.dom);
|
||||
const checkbox = $(vnode.dom)
|
||||
.children('mwc-checkbox');
|
||||
|
||||
checkbox.on('change', () => {
|
||||
$(vnode.dom)
|
||||
.closest('table')
|
||||
.find('tbody tr[checkable] mwc-checkbox')
|
||||
.prop('checked', checkbox.prop('checked'));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import Component from '../Component.jsx';
|
||||
|
||||
export default class TableHead extends Component {
|
||||
view(vnode) {
|
||||
return <thead {...this.attrs.all()}>{vnode.children}</thead>;
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import Component from '../Component.jsx';
|
||||
|
||||
/**
|
||||
* Attributes:
|
||||
* - type: numeric, checkbox
|
||||
*/
|
||||
export default class TableHeadCell extends Component {
|
||||
view(vnode) {
|
||||
this.attrs.addClassNames('mdc-data-table__header-cell', {
|
||||
[`mdc-data-table__header-cell--${this.attrs.get('type')}`]: this.attrs.has('type')
|
||||
});
|
||||
return <th {...this.attrs.all()} role="columnheader" scope="col">{vnode.children}</th>;
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
import Component from '../Component.jsx';
|
||||
|
||||
export default class TableHeadRow extends Component {
|
||||
view(vnode) {
|
||||
this.attrs.addClassNames('mdc-data-table__header-row');
|
||||
return <tr {...this.attrs.all()}>{vnode.children}</tr>;
|
||||
}
|
||||
}
|
@ -1,8 +1,36 @@
|
||||
import '@material/mwc-checkbox';
|
||||
|
||||
import {
|
||||
type Children,
|
||||
type Vnode
|
||||
} from 'mithril';
|
||||
|
||||
import Component from '../Component.jsx';
|
||||
import TableCell from './TableCell.jsx';
|
||||
|
||||
export default class TableRow extends Component {
|
||||
view(vnode) {
|
||||
this.attrs.addClassNames('mdc-data-table__row');
|
||||
return <tr {...this.attrs.all()}>{vnode.children}</tr>;
|
||||
|
||||
return (
|
||||
<tr {...this.attrs.all()}>
|
||||
{this.checkbox(vnode.children)}
|
||||
{vnode.children}
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
checkbox(children: Array<Children>): Children {
|
||||
if (!this.attrs.has('checkable')) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
for (const child: Vnode of children) {
|
||||
if (child.attrs.type === 'checkbox') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return <TableCell type="checkbox"/>;
|
||||
}
|
||||
}
|
||||
|
5
resources/js/Components/DataTable/index.js
vendored
5
resources/js/Components/DataTable/index.js
vendored
@ -1,9 +1,6 @@
|
||||
export { default as DataTable } from './DataTable.jsx';
|
||||
export { default as TableBody } from './TableBody.jsx';
|
||||
export { default as TableCell } from './TableCell.jsx';
|
||||
export { default as TableColumn } from './TableColumn.jsx';
|
||||
export { default as TableFooter } from './TableFooter.jsx';
|
||||
export { default as TableHead } from './TableHead.jsx';
|
||||
export { default as TableHeadCell } from './TableHeadCell.jsx';
|
||||
export { default as TableHeadRow } from './TableHeadRow.jsx';
|
||||
export { default as TableRow } from './TableRow.jsx';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user