codex 1.6.0a11__py3-none-any.whl → 1.6.0a12__py3-none-any.whl
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.
Potentially problematic release.
This version of codex might be problematic. Click here for more details.
- codex/librarian/covers/create.py +21 -16
- codex/serializers/browser/choices.py +21 -54
- codex/serializers/browser/filters.py +30 -36
- codex/serializers/browser/mixins.py +2 -2
- codex/serializers/fields.py +32 -65
- codex/serializers/opds/v2.py +4 -6
- codex/static_root/assets/{VCheckbox-BwDyxhU7.831b00df198a.js → VCheckbox-B3vCf1Vu.e1991f98ab6c.js} +1 -1
- codex/static_root/assets/VCheckbox-B3vCf1Vu.e1991f98ab6c.js.br +0 -0
- codex/static_root/assets/VCheckbox-B3vCf1Vu.e1991f98ab6c.js.gz +0 -0
- codex/static_root/assets/{VCheckbox-BwDyxhU7.js → VCheckbox-B3vCf1Vu.js} +1 -1
- codex/static_root/assets/VCheckbox-B3vCf1Vu.js.br +0 -0
- codex/static_root/assets/VCheckbox-B3vCf1Vu.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-DVq5lDK4.5e6464c8d80a.js → VCheckboxBtn-Cj6bUYmw.196cc43ca1c8.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Cj6bUYmw.196cc43ca1c8.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Cj6bUYmw.196cc43ca1c8.js.gz +0 -0
- codex/static_root/assets/{VCheckboxBtn-DVq5lDK4.js → VCheckboxBtn-Cj6bUYmw.js} +1 -1
- codex/static_root/assets/VCheckboxBtn-Cj6bUYmw.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-Cj6bUYmw.js.gz +0 -0
- codex/static_root/assets/{VCombobox-BASCOy0n.7801caa5e192.js → VCombobox-wIqJY8no.3547ff73e91e.js} +1 -1
- codex/static_root/assets/VCombobox-wIqJY8no.3547ff73e91e.js.br +0 -0
- codex/static_root/assets/VCombobox-wIqJY8no.3547ff73e91e.js.gz +0 -0
- codex/static_root/assets/{VCombobox-BASCOy0n.js → VCombobox-wIqJY8no.js} +1 -1
- codex/static_root/assets/VCombobox-wIqJY8no.js.br +0 -0
- codex/static_root/assets/VCombobox-wIqJY8no.js.gz +0 -0
- codex/static_root/assets/{VDialog-DnbL_v_u.0bd289bda8e6.js → VDialog-D6HUFV6a.ac71da510b3f.js} +1 -1
- codex/static_root/assets/VDialog-D6HUFV6a.ac71da510b3f.js.br +0 -0
- codex/static_root/assets/VDialog-D6HUFV6a.ac71da510b3f.js.gz +0 -0
- codex/static_root/assets/{VDialog-DnbL_v_u.js → VDialog-D6HUFV6a.js} +1 -1
- codex/static_root/assets/VDialog-D6HUFV6a.js.br +0 -0
- codex/static_root/assets/VDialog-D6HUFV6a.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-B8nz8lN5.56e5adec4f62.js → VExpansionPanels-BUJaYmzY.44e8a00a2ebe.js} +1 -1
- codex/static_root/assets/VExpansionPanels-BUJaYmzY.44e8a00a2ebe.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-BUJaYmzY.44e8a00a2ebe.js.gz +0 -0
- codex/static_root/assets/{VExpansionPanels-B8nz8lN5.js → VExpansionPanels-BUJaYmzY.js} +1 -1
- codex/static_root/assets/VExpansionPanels-BUJaYmzY.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-BUJaYmzY.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-BgwJ_b94.55f84f3429b9.js → VRadioGroup-CayclHra.0a5b1c9a7b71.js} +1 -1
- codex/static_root/assets/VRadioGroup-CayclHra.0a5b1c9a7b71.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CayclHra.0a5b1c9a7b71.js.gz +0 -0
- codex/static_root/assets/{VRadioGroup-BgwJ_b94.js → VRadioGroup-CayclHra.js} +1 -1
- codex/static_root/assets/VRadioGroup-CayclHra.js.br +0 -0
- codex/static_root/assets/VRadioGroup-CayclHra.js.gz +0 -0
- codex/static_root/assets/{VSelect-BoKpXxwe.a88f065dfe3b.js → VSelect-ou2Q9UaN.8ddd219784e1.js} +1 -1
- codex/static_root/assets/VSelect-ou2Q9UaN.8ddd219784e1.js.br +0 -0
- codex/static_root/assets/VSelect-ou2Q9UaN.8ddd219784e1.js.gz +0 -0
- codex/static_root/assets/{VSelect-BoKpXxwe.js → VSelect-ou2Q9UaN.js} +1 -1
- codex/static_root/assets/VSelect-ou2Q9UaN.js.br +0 -0
- codex/static_root/assets/VSelect-ou2Q9UaN.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-BXJGg8No.js → VSelectionControl-BOKIwNZb.16e0cdde978c.js} +1 -1
- codex/static_root/assets/VSelectionControl-BOKIwNZb.16e0cdde978c.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BOKIwNZb.16e0cdde978c.js.gz +0 -0
- codex/static_root/assets/{VSelectionControl-BXJGg8No.0cb36d941d2a.js → VSelectionControl-BOKIwNZb.js} +1 -1
- codex/static_root/assets/VSelectionControl-BOKIwNZb.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BOKIwNZb.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-C2TL5E34.775adeb5a973.js → VSlideGroup-C3XgVg2T.d2b0ee4f596c.js} +1 -1
- codex/static_root/assets/VSlideGroup-C3XgVg2T.d2b0ee4f596c.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C3XgVg2T.d2b0ee4f596c.js.gz +0 -0
- codex/static_root/assets/{VSlideGroup-C2TL5E34.js → VSlideGroup-C3XgVg2T.js} +1 -1
- codex/static_root/assets/VSlideGroup-C3XgVg2T.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C3XgVg2T.js.gz +0 -0
- codex/static_root/assets/{VTable-C0FptljX.e4840b635c6e.js → VTable-CrIiBr9q.b4669247af45.js} +1 -1
- codex/static_root/assets/VTable-CrIiBr9q.b4669247af45.js.br +0 -0
- codex/static_root/assets/VTable-CrIiBr9q.b4669247af45.js.gz +0 -0
- codex/static_root/assets/{VTable-C0FptljX.js → VTable-CrIiBr9q.js} +1 -1
- codex/static_root/assets/VTable-CrIiBr9q.js.br +0 -0
- codex/static_root/assets/VTable-CrIiBr9q.js.gz +0 -0
- codex/static_root/assets/{VTextField-Aw8nKhY6.428732ac22d7.js → VTextField-HAAxrpNi.6f6dcb50079a.js} +1 -1
- codex/static_root/assets/VTextField-HAAxrpNi.6f6dcb50079a.js.br +0 -0
- codex/static_root/assets/VTextField-HAAxrpNi.6f6dcb50079a.js.gz +0 -0
- codex/static_root/assets/{VTextField-Aw8nKhY6.js → VTextField-HAAxrpNi.js} +1 -1
- codex/static_root/assets/VTextField-HAAxrpNi.js.br +0 -0
- codex/static_root/assets/VTextField-HAAxrpNi.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-D9j_u9MX.828acf3dee55.js → VWindowItem-aal6-Uv4.d178e2af20a7.js} +1 -1
- codex/static_root/assets/VWindowItem-aal6-Uv4.d178e2af20a7.js.br +0 -0
- codex/static_root/assets/VWindowItem-aal6-Uv4.d178e2af20a7.js.gz +0 -0
- codex/static_root/assets/{VWindowItem-D9j_u9MX.js → VWindowItem-aal6-Uv4.js} +1 -1
- codex/static_root/assets/VWindowItem-aal6-Uv4.js.br +0 -0
- codex/static_root/assets/VWindowItem-aal6-Uv4.js.gz +0 -0
- codex/static_root/assets/admin-D5JDmLDy.e4df3dd3a3fe.js +1 -0
- codex/static_root/assets/admin-D5JDmLDy.e4df3dd3a3fe.js.br +0 -0
- codex/static_root/assets/admin-D5JDmLDy.e4df3dd3a3fe.js.gz +0 -0
- codex/static_root/assets/admin-D5JDmLDy.js +1 -0
- codex/static_root/assets/admin-D5JDmLDy.js.br +0 -0
- codex/static_root/assets/admin-D5JDmLDy.js.gz +0 -0
- codex/static_root/assets/{admin-drawer-panel-Dmn4wEY3.af7e8490f0e3.js → admin-drawer-panel-BF-h3Wm0.1f372db8d08f.js} +2 -2
- codex/static_root/assets/admin-drawer-panel-BF-h3Wm0.1f372db8d08f.js.br +0 -0
- codex/static_root/assets/{admin-drawer-panel-Dmn4wEY3.af7e8490f0e3.js.gz → admin-drawer-panel-BF-h3Wm0.1f372db8d08f.js.gz} +0 -0
- codex/static_root/assets/{admin-drawer-panel-Dmn4wEY3.js → admin-drawer-panel-BF-h3Wm0.js} +2 -2
- codex/static_root/assets/admin-drawer-panel-BF-h3Wm0.js.br +0 -0
- codex/static_root/assets/{admin-drawer-panel-Dmn4wEY3.js.gz → admin-drawer-panel-BF-h3Wm0.js.gz} +0 -0
- codex/static_root/assets/browser-B1-dPld9.0b3fa4fdbe22.css +1 -0
- codex/static_root/assets/browser-B1-dPld9.0b3fa4fdbe22.css.br +0 -0
- codex/static_root/assets/browser-B1-dPld9.0b3fa4fdbe22.css.gz +0 -0
- codex/static_root/assets/browser-B1-dPld9.css +1 -0
- codex/static_root/assets/browser-B1-dPld9.css.br +0 -0
- codex/static_root/assets/browser-B1-dPld9.css.gz +0 -0
- codex/static_root/assets/browser-VhFkImB_.9c3b2c746614.js +1 -0
- codex/static_root/assets/browser-VhFkImB_.9c3b2c746614.js.br +0 -0
- codex/static_root/assets/browser-VhFkImB_.9c3b2c746614.js.gz +0 -0
- codex/static_root/assets/browser-VhFkImB_.js +1 -0
- codex/static_root/assets/browser-VhFkImB_.js.br +0 -0
- codex/static_root/assets/browser-VhFkImB_.js.gz +0 -0
- codex/static_root/assets/{change-password-dialog-Cc1e755p.b29d200537bf.js → change-password-dialog-BCYw5K7E.a8bae0450f20.js} +1 -1
- codex/static_root/assets/change-password-dialog-BCYw5K7E.a8bae0450f20.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BCYw5K7E.a8bae0450f20.js.gz +0 -0
- codex/static_root/assets/{change-password-dialog-Cc1e755p.js → change-password-dialog-BCYw5K7E.js} +1 -1
- codex/static_root/assets/change-password-dialog-BCYw5K7E.js.br +0 -0
- codex/static_root/assets/change-password-dialog-BCYw5K7E.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-Cyr7HAAz.8ab1d8b6241a.js → confirm-dialog-c9JOSGSy.3c5788f95f47.js} +1 -1
- codex/static_root/assets/confirm-dialog-c9JOSGSy.3c5788f95f47.js.br +3 -0
- codex/static_root/assets/confirm-dialog-c9JOSGSy.3c5788f95f47.js.gz +0 -0
- codex/static_root/assets/{confirm-dialog-Cyr7HAAz.js → confirm-dialog-c9JOSGSy.js} +1 -1
- codex/static_root/assets/confirm-dialog-c9JOSGSy.js.br +3 -0
- codex/static_root/assets/confirm-dialog-c9JOSGSy.js.gz +0 -0
- codex/static_root/assets/{datetime-column-Cqi99Ze-.49d0ce340183.js → datetime-column-D-6LPKdI.d46bbd8134df.js} +1 -1
- codex/static_root/assets/datetime-column-D-6LPKdI.d46bbd8134df.js.br +0 -0
- codex/static_root/assets/datetime-column-D-6LPKdI.d46bbd8134df.js.gz +0 -0
- codex/static_root/assets/{datetime-column-Cqi99Ze-.js → datetime-column-D-6LPKdI.js} +1 -1
- codex/static_root/assets/datetime-column-D-6LPKdI.js.br +0 -0
- codex/static_root/assets/datetime-column-D-6LPKdI.js.gz +0 -0
- codex/static_root/assets/{filter-CuocBoS2.885d1b8d44cc.js → filter-BOnVoHTU.93c3d0d0d3f6.js} +1 -1
- codex/static_root/assets/filter-BOnVoHTU.93c3d0d0d3f6.js.br +0 -0
- codex/static_root/assets/filter-BOnVoHTU.93c3d0d0d3f6.js.gz +0 -0
- codex/static_root/assets/{filter-CuocBoS2.js → filter-BOnVoHTU.js} +1 -1
- codex/static_root/assets/filter-BOnVoHTU.js.br +0 -0
- codex/static_root/assets/filter-BOnVoHTU.js.gz +0 -0
- codex/static_root/assets/{flag-tab-B5dRCBAt.e858f7ec9f55.js → flag-tab-IniE-dLy.a02733e359aa.js} +1 -1
- codex/static_root/assets/flag-tab-IniE-dLy.a02733e359aa.js.br +0 -0
- codex/static_root/assets/flag-tab-IniE-dLy.a02733e359aa.js.gz +0 -0
- codex/static_root/assets/{flag-tab-B5dRCBAt.js → flag-tab-IniE-dLy.js} +1 -1
- codex/static_root/assets/flag-tab-IniE-dLy.js.br +0 -0
- codex/static_root/assets/flag-tab-IniE-dLy.js.gz +0 -0
- codex/static_root/assets/{group-tab-_nT2o04v.c06032b254dc.js → group-tab-RPa8XC0J.3d483919ea92.js} +1 -1
- codex/static_root/assets/group-tab-RPa8XC0J.3d483919ea92.js.br +0 -0
- codex/static_root/assets/group-tab-RPa8XC0J.3d483919ea92.js.gz +0 -0
- codex/static_root/assets/{group-tab-_nT2o04v.js → group-tab-RPa8XC0J.js} +1 -1
- codex/static_root/assets/group-tab-RPa8XC0J.js.br +0 -0
- codex/static_root/assets/group-tab-RPa8XC0J.js.gz +0 -0
- codex/static_root/assets/{http-error-CXo9qLiW.d5a337f399c9.js → http-error-DBQycf8i.561cde2b4598.js} +1 -1
- codex/static_root/assets/http-error-DBQycf8i.561cde2b4598.js.br +0 -0
- codex/static_root/assets/http-error-DBQycf8i.561cde2b4598.js.gz +0 -0
- codex/static_root/assets/{http-error-CXo9qLiW.js → http-error-DBQycf8i.js} +1 -1
- codex/static_root/assets/http-error-DBQycf8i.js.br +0 -0
- codex/static_root/assets/http-error-DBQycf8i.js.gz +0 -0
- codex/static_root/assets/{library-tab-lz5QMD4i.2f04b226ebe8.js → library-tab-C5trLvkq.35c7a1b79c71.js} +1 -1
- codex/static_root/assets/library-tab-C5trLvkq.35c7a1b79c71.js.br +0 -0
- codex/static_root/assets/library-tab-C5trLvkq.35c7a1b79c71.js.gz +0 -0
- codex/static_root/assets/{library-tab-lz5QMD4i.js → library-tab-C5trLvkq.js} +1 -1
- codex/static_root/assets/library-tab-C5trLvkq.js.br +0 -0
- codex/static_root/assets/library-tab-C5trLvkq.js.gz +0 -0
- codex/static_root/assets/main-x0Pcl23A.364bfe447c9c.js +32 -0
- codex/static_root/assets/main-x0Pcl23A.364bfe447c9c.js.br +0 -0
- codex/static_root/assets/main-x0Pcl23A.364bfe447c9c.js.gz +0 -0
- codex/static_root/assets/main-x0Pcl23A.js +32 -0
- codex/static_root/assets/main-x0Pcl23A.js.br +0 -0
- codex/static_root/assets/main-x0Pcl23A.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BLUoVz2y.50051431acf1.css +1 -0
- codex/static_root/assets/pagination-toolbar-BLUoVz2y.50051431acf1.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-BLUoVz2y.50051431acf1.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BLUoVz2y.css +1 -0
- codex/static_root/assets/pagination-toolbar-BLUoVz2y.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-BLUoVz2y.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-DEgDOzzp.71aa03f525e4.js +1 -0
- codex/static_root/assets/pagination-toolbar-DEgDOzzp.71aa03f525e4.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-DEgDOzzp.71aa03f525e4.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-DEgDOzzp.js +1 -0
- codex/static_root/assets/pagination-toolbar-DEgDOzzp.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-DEgDOzzp.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BpZdmj2g.93e86d9c7927.js → pdf-doc-CkV-xfvG.35c1a6a19a41.js} +1 -1
- codex/static_root/assets/pdf-doc-CkV-xfvG.35c1a6a19a41.js.br +0 -0
- codex/static_root/assets/pdf-doc-CkV-xfvG.35c1a6a19a41.js.gz +0 -0
- codex/static_root/assets/{pdf-doc-BpZdmj2g.js → pdf-doc-CkV-xfvG.js} +1 -1
- codex/static_root/assets/pdf-doc-CkV-xfvG.js.br +0 -0
- codex/static_root/assets/pdf-doc-CkV-xfvG.js.gz +0 -0
- codex/static_root/assets/{reader-CRJUR2qj.55d626f0f9fa.js → reader-ClcgSG93.6afe950e70ac.js} +2 -2
- codex/static_root/assets/reader-ClcgSG93.6afe950e70ac.js.br +0 -0
- codex/static_root/assets/reader-ClcgSG93.6afe950e70ac.js.gz +0 -0
- codex/static_root/assets/{reader-CRJUR2qj.js → reader-ClcgSG93.js} +2 -2
- codex/static_root/assets/reader-ClcgSG93.js.br +0 -0
- codex/static_root/assets/reader-ClcgSG93.js.gz +0 -0
- codex/static_root/assets/{relation-chips-NgDnInw_.3b5ba16f68f0.js → relation-chips-2vga5ApB.d94c344f909b.js} +1 -1
- codex/static_root/assets/relation-chips-2vga5ApB.d94c344f909b.js.br +0 -0
- codex/static_root/assets/relation-chips-2vga5ApB.d94c344f909b.js.gz +0 -0
- codex/static_root/assets/{relation-chips-NgDnInw_.js → relation-chips-2vga5ApB.js} +1 -1
- codex/static_root/assets/relation-chips-2vga5ApB.js.br +0 -0
- codex/static_root/assets/relation-chips-2vga5ApB.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BaQT27kc.js → settings-drawer-BOTI_tHr.03748f801e08.js} +2 -2
- codex/static_root/assets/settings-drawer-BOTI_tHr.03748f801e08.js.br +0 -0
- codex/static_root/assets/settings-drawer-BOTI_tHr.03748f801e08.js.gz +0 -0
- codex/static_root/assets/{settings-drawer-BaQT27kc.e43fc1527b66.js → settings-drawer-BOTI_tHr.js} +2 -2
- codex/static_root/assets/settings-drawer-BOTI_tHr.js.br +0 -0
- codex/static_root/assets/settings-drawer-BOTI_tHr.js.gz +0 -0
- codex/static_root/assets/{stats-tab-DoHb54IU.30d7deea7b9f.js → stats-tab-CBz_jhmH.9bdc41225f06.js} +1 -1
- codex/static_root/assets/stats-tab-CBz_jhmH.9bdc41225f06.js.br +0 -0
- codex/static_root/assets/stats-tab-CBz_jhmH.9bdc41225f06.js.gz +0 -0
- codex/static_root/assets/{stats-tab-DoHb54IU.js → stats-tab-CBz_jhmH.js} +1 -1
- codex/static_root/assets/stats-tab-CBz_jhmH.js.br +0 -0
- codex/static_root/assets/stats-tab-CBz_jhmH.js.gz +0 -0
- codex/static_root/assets/{task-tab-B88ucu1U.4f240e3d82c4.js → task-tab-B8sYV6Ia.90a8deec0214.js} +1 -1
- codex/static_root/assets/task-tab-B8sYV6Ia.90a8deec0214.js.br +0 -0
- codex/static_root/assets/task-tab-B8sYV6Ia.90a8deec0214.js.gz +0 -0
- codex/static_root/assets/{task-tab-B88ucu1U.js → task-tab-B8sYV6Ia.js} +1 -1
- codex/static_root/assets/task-tab-B8sYV6Ia.js.br +0 -0
- codex/static_root/assets/task-tab-B8sYV6Ia.js.gz +0 -0
- codex/static_root/assets/to-case-CnnzURtN.f0e4b42ddb89.js +1 -0
- codex/static_root/assets/to-case-CnnzURtN.js +1 -0
- codex/static_root/assets/{unauthorized-AnKtlgGy.62ee74d4373c.js → unauthorized-D5-FvA2_.61b1cd239b47.js} +1 -1
- codex/static_root/assets/unauthorized-D5-FvA2_.61b1cd239b47.js.br +0 -0
- codex/static_root/assets/unauthorized-D5-FvA2_.61b1cd239b47.js.gz +0 -0
- codex/static_root/assets/{unauthorized-AnKtlgGy.js → unauthorized-D5-FvA2_.js} +1 -1
- codex/static_root/assets/unauthorized-D5-FvA2_.js.br +0 -0
- codex/static_root/assets/unauthorized-D5-FvA2_.js.gz +0 -0
- codex/static_root/assets/{user-tab-BxtZ2u7W.161cc8f0dcce.js → user-tab-pzFjrggM.97c02ebee729.js} +1 -1
- codex/static_root/assets/user-tab-pzFjrggM.97c02ebee729.js.br +0 -0
- codex/static_root/assets/user-tab-pzFjrggM.97c02ebee729.js.gz +0 -0
- codex/static_root/assets/{user-tab-BxtZ2u7W.js → user-tab-pzFjrggM.js} +1 -1
- codex/static_root/assets/user-tab-pzFjrggM.js.br +0 -0
- codex/static_root/assets/user-tab-pzFjrggM.js.gz +0 -0
- codex/static_root/{manifest.3851c028b0cb.json → manifest.a18726680d5f.json} +222 -222
- codex/static_root/manifest.a18726680d5f.json.br +0 -0
- codex/static_root/manifest.a18726680d5f.json.gz +0 -0
- codex/static_root/manifest.json +222 -222
- codex/static_root/manifest.json.br +0 -0
- codex/static_root/manifest.json.gz +0 -0
- codex/static_root/staticfiles.json +1 -1
- codex/views/browser/cover.py +13 -15
- codex/views/browser/metadata.py +5 -5
- codex/views/reader/page.py +13 -2
- codex/views/util.py +13 -0
- {codex-1.6.0a11.dist-info → codex-1.6.0a12.dist-info}/METADATA +1 -1
- {codex-1.6.0a11.dist-info → codex-1.6.0a12.dist-info}/RECORD +234 -236
- codex/static_root/assets/VCheckbox-BwDyxhU7.831b00df198a.js.br +0 -0
- codex/static_root/assets/VCheckbox-BwDyxhU7.831b00df198a.js.gz +0 -0
- codex/static_root/assets/VCheckbox-BwDyxhU7.js.br +0 -0
- codex/static_root/assets/VCheckbox-BwDyxhU7.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-DVq5lDK4.5e6464c8d80a.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-DVq5lDK4.5e6464c8d80a.js.gz +0 -0
- codex/static_root/assets/VCheckboxBtn-DVq5lDK4.js.br +0 -0
- codex/static_root/assets/VCheckboxBtn-DVq5lDK4.js.gz +0 -0
- codex/static_root/assets/VCombobox-BASCOy0n.7801caa5e192.js.br +0 -0
- codex/static_root/assets/VCombobox-BASCOy0n.7801caa5e192.js.gz +0 -0
- codex/static_root/assets/VCombobox-BASCOy0n.js.br +0 -0
- codex/static_root/assets/VCombobox-BASCOy0n.js.gz +0 -0
- codex/static_root/assets/VDialog-DnbL_v_u.0bd289bda8e6.js.br +0 -0
- codex/static_root/assets/VDialog-DnbL_v_u.0bd289bda8e6.js.gz +0 -0
- codex/static_root/assets/VDialog-DnbL_v_u.js.br +0 -0
- codex/static_root/assets/VDialog-DnbL_v_u.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-B8nz8lN5.56e5adec4f62.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-B8nz8lN5.56e5adec4f62.js.gz +0 -0
- codex/static_root/assets/VExpansionPanels-B8nz8lN5.js.br +0 -0
- codex/static_root/assets/VExpansionPanels-B8nz8lN5.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-BgwJ_b94.55f84f3429b9.js.br +0 -0
- codex/static_root/assets/VRadioGroup-BgwJ_b94.55f84f3429b9.js.gz +0 -0
- codex/static_root/assets/VRadioGroup-BgwJ_b94.js.br +0 -0
- codex/static_root/assets/VRadioGroup-BgwJ_b94.js.gz +0 -0
- codex/static_root/assets/VSelect-BoKpXxwe.a88f065dfe3b.js.br +0 -0
- codex/static_root/assets/VSelect-BoKpXxwe.a88f065dfe3b.js.gz +0 -0
- codex/static_root/assets/VSelect-BoKpXxwe.js.br +0 -0
- codex/static_root/assets/VSelect-BoKpXxwe.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-BXJGg8No.0cb36d941d2a.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BXJGg8No.0cb36d941d2a.js.gz +0 -0
- codex/static_root/assets/VSelectionControl-BXJGg8No.js.br +0 -0
- codex/static_root/assets/VSelectionControl-BXJGg8No.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-C2TL5E34.775adeb5a973.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C2TL5E34.775adeb5a973.js.gz +0 -0
- codex/static_root/assets/VSlideGroup-C2TL5E34.js.br +0 -0
- codex/static_root/assets/VSlideGroup-C2TL5E34.js.gz +0 -0
- codex/static_root/assets/VTable-C0FptljX.e4840b635c6e.js.br +0 -0
- codex/static_root/assets/VTable-C0FptljX.e4840b635c6e.js.gz +0 -0
- codex/static_root/assets/VTable-C0FptljX.js.br +0 -0
- codex/static_root/assets/VTable-C0FptljX.js.gz +0 -0
- codex/static_root/assets/VTextField-Aw8nKhY6.428732ac22d7.js.br +0 -0
- codex/static_root/assets/VTextField-Aw8nKhY6.428732ac22d7.js.gz +0 -0
- codex/static_root/assets/VTextField-Aw8nKhY6.js.br +0 -0
- codex/static_root/assets/VTextField-Aw8nKhY6.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D9j_u9MX.828acf3dee55.js.br +0 -0
- codex/static_root/assets/VWindowItem-D9j_u9MX.828acf3dee55.js.gz +0 -0
- codex/static_root/assets/VWindowItem-D9j_u9MX.js.br +0 -0
- codex/static_root/assets/VWindowItem-D9j_u9MX.js.gz +0 -0
- codex/static_root/assets/admin-drawer-panel-Dmn4wEY3.af7e8490f0e3.js.br +0 -0
- codex/static_root/assets/admin-drawer-panel-Dmn4wEY3.js.br +0 -0
- codex/static_root/assets/admin-jf7zR2p_.4741813376d2.js +0 -1
- codex/static_root/assets/admin-jf7zR2p_.4741813376d2.js.br +0 -0
- codex/static_root/assets/admin-jf7zR2p_.4741813376d2.js.gz +0 -0
- codex/static_root/assets/admin-jf7zR2p_.js +0 -1
- codex/static_root/assets/admin-jf7zR2p_.js.br +0 -0
- codex/static_root/assets/admin-jf7zR2p_.js.gz +0 -0
- codex/static_root/assets/browser-BKZuypzF.86e5333bd7d6.js +0 -1
- codex/static_root/assets/browser-BKZuypzF.86e5333bd7d6.js.br +0 -0
- codex/static_root/assets/browser-BKZuypzF.86e5333bd7d6.js.gz +0 -0
- codex/static_root/assets/browser-BKZuypzF.js +0 -1
- codex/static_root/assets/browser-BKZuypzF.js.br +0 -0
- codex/static_root/assets/browser-BKZuypzF.js.gz +0 -0
- codex/static_root/assets/browser-D7xci5SY.css +0 -1
- codex/static_root/assets/browser-D7xci5SY.css.br +0 -0
- codex/static_root/assets/browser-D7xci5SY.css.gz +0 -0
- codex/static_root/assets/browser-D7xci5SY.fa305e14005c.css +0 -1
- codex/static_root/assets/browser-D7xci5SY.fa305e14005c.css.br +0 -0
- codex/static_root/assets/browser-D7xci5SY.fa305e14005c.css.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cc1e755p.b29d200537bf.js.br +0 -0
- codex/static_root/assets/change-password-dialog-Cc1e755p.b29d200537bf.js.gz +0 -0
- codex/static_root/assets/change-password-dialog-Cc1e755p.js.br +0 -0
- codex/static_root/assets/change-password-dialog-Cc1e755p.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-Cyr7HAAz.8ab1d8b6241a.js.br +0 -0
- codex/static_root/assets/confirm-dialog-Cyr7HAAz.8ab1d8b6241a.js.gz +0 -0
- codex/static_root/assets/confirm-dialog-Cyr7HAAz.js.br +0 -0
- codex/static_root/assets/confirm-dialog-Cyr7HAAz.js.gz +0 -0
- codex/static_root/assets/datetime-column-Cqi99Ze-.49d0ce340183.js.br +0 -0
- codex/static_root/assets/datetime-column-Cqi99Ze-.49d0ce340183.js.gz +0 -0
- codex/static_root/assets/datetime-column-Cqi99Ze-.js.br +0 -0
- codex/static_root/assets/datetime-column-Cqi99Ze-.js.gz +0 -0
- codex/static_root/assets/filter-CuocBoS2.885d1b8d44cc.js.br +0 -0
- codex/static_root/assets/filter-CuocBoS2.885d1b8d44cc.js.gz +0 -0
- codex/static_root/assets/filter-CuocBoS2.js.br +0 -0
- codex/static_root/assets/filter-CuocBoS2.js.gz +0 -0
- codex/static_root/assets/flag-tab-B5dRCBAt.e858f7ec9f55.js.br +0 -0
- codex/static_root/assets/flag-tab-B5dRCBAt.e858f7ec9f55.js.gz +0 -0
- codex/static_root/assets/flag-tab-B5dRCBAt.js.br +0 -0
- codex/static_root/assets/flag-tab-B5dRCBAt.js.gz +0 -0
- codex/static_root/assets/group-tab-_nT2o04v.c06032b254dc.js.br +0 -0
- codex/static_root/assets/group-tab-_nT2o04v.c06032b254dc.js.gz +0 -0
- codex/static_root/assets/group-tab-_nT2o04v.js.br +0 -0
- codex/static_root/assets/group-tab-_nT2o04v.js.gz +0 -0
- codex/static_root/assets/http-error-CXo9qLiW.d5a337f399c9.js.br +0 -0
- codex/static_root/assets/http-error-CXo9qLiW.d5a337f399c9.js.gz +0 -0
- codex/static_root/assets/http-error-CXo9qLiW.js.br +0 -0
- codex/static_root/assets/http-error-CXo9qLiW.js.gz +0 -0
- codex/static_root/assets/library-tab-lz5QMD4i.2f04b226ebe8.js.br +0 -0
- codex/static_root/assets/library-tab-lz5QMD4i.2f04b226ebe8.js.gz +0 -0
- codex/static_root/assets/library-tab-lz5QMD4i.js.br +0 -0
- codex/static_root/assets/library-tab-lz5QMD4i.js.gz +0 -0
- codex/static_root/assets/main-17i0EBCp.7093c3f755f1.js +0 -32
- codex/static_root/assets/main-17i0EBCp.7093c3f755f1.js.br +0 -0
- codex/static_root/assets/main-17i0EBCp.7093c3f755f1.js.gz +0 -0
- codex/static_root/assets/main-17i0EBCp.js +0 -32
- codex/static_root/assets/main-17i0EBCp.js.br +0 -0
- codex/static_root/assets/main-17i0EBCp.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BBvsIXTd.ad891da6617a.js +0 -1
- codex/static_root/assets/pagination-toolbar-BBvsIXTd.ad891da6617a.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-BBvsIXTd.ad891da6617a.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-BBvsIXTd.js +0 -1
- codex/static_root/assets/pagination-toolbar-BBvsIXTd.js.br +0 -0
- codex/static_root/assets/pagination-toolbar-BBvsIXTd.js.gz +0 -0
- codex/static_root/assets/pagination-toolbar-B_zL7BQQ.css +0 -1
- codex/static_root/assets/pagination-toolbar-B_zL7BQQ.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-B_zL7BQQ.css.gz +0 -0
- codex/static_root/assets/pagination-toolbar-B_zL7BQQ.d1311bd41edc.css +0 -1
- codex/static_root/assets/pagination-toolbar-B_zL7BQQ.d1311bd41edc.css.br +0 -0
- codex/static_root/assets/pagination-toolbar-B_zL7BQQ.d1311bd41edc.css.gz +0 -0
- codex/static_root/assets/pdf-doc-BpZdmj2g.93e86d9c7927.js.br +0 -0
- codex/static_root/assets/pdf-doc-BpZdmj2g.93e86d9c7927.js.gz +0 -0
- codex/static_root/assets/pdf-doc-BpZdmj2g.js.br +0 -0
- codex/static_root/assets/pdf-doc-BpZdmj2g.js.gz +0 -0
- codex/static_root/assets/reader-CRJUR2qj.55d626f0f9fa.js.br +0 -0
- codex/static_root/assets/reader-CRJUR2qj.55d626f0f9fa.js.gz +0 -0
- codex/static_root/assets/reader-CRJUR2qj.js.br +0 -0
- codex/static_root/assets/reader-CRJUR2qj.js.gz +0 -0
- codex/static_root/assets/relation-chips-NgDnInw_.3b5ba16f68f0.js.br +0 -0
- codex/static_root/assets/relation-chips-NgDnInw_.3b5ba16f68f0.js.gz +0 -0
- codex/static_root/assets/relation-chips-NgDnInw_.js.br +0 -0
- codex/static_root/assets/relation-chips-NgDnInw_.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BaQT27kc.e43fc1527b66.js.br +0 -0
- codex/static_root/assets/settings-drawer-BaQT27kc.e43fc1527b66.js.gz +0 -0
- codex/static_root/assets/settings-drawer-BaQT27kc.js.br +0 -0
- codex/static_root/assets/settings-drawer-BaQT27kc.js.gz +0 -0
- codex/static_root/assets/stats-tab-DoHb54IU.30d7deea7b9f.js.br +0 -0
- codex/static_root/assets/stats-tab-DoHb54IU.30d7deea7b9f.js.gz +0 -0
- codex/static_root/assets/stats-tab-DoHb54IU.js.br +0 -0
- codex/static_root/assets/stats-tab-DoHb54IU.js.gz +0 -0
- codex/static_root/assets/task-tab-B88ucu1U.4f240e3d82c4.js.br +0 -0
- codex/static_root/assets/task-tab-B88ucu1U.4f240e3d82c4.js.gz +0 -0
- codex/static_root/assets/task-tab-B88ucu1U.js.br +0 -0
- codex/static_root/assets/task-tab-B88ucu1U.js.gz +0 -0
- codex/static_root/assets/to-case-B7MjLIw-.08fc8412de69.js +0 -1
- codex/static_root/assets/to-case-B7MjLIw-.08fc8412de69.js.br +0 -0
- codex/static_root/assets/to-case-B7MjLIw-.js +0 -1
- codex/static_root/assets/to-case-B7MjLIw-.js.br +0 -0
- codex/static_root/assets/unauthorized-AnKtlgGy.62ee74d4373c.js.br +0 -0
- codex/static_root/assets/unauthorized-AnKtlgGy.62ee74d4373c.js.gz +0 -0
- codex/static_root/assets/unauthorized-AnKtlgGy.js.br +0 -0
- codex/static_root/assets/unauthorized-AnKtlgGy.js.gz +0 -0
- codex/static_root/assets/user-tab-BxtZ2u7W.161cc8f0dcce.js.br +0 -0
- codex/static_root/assets/user-tab-BxtZ2u7W.161cc8f0dcce.js.gz +0 -0
- codex/static_root/assets/user-tab-BxtZ2u7W.js.br +0 -0
- codex/static_root/assets/user-tab-BxtZ2u7W.js.gz +0 -0
- codex/static_root/manifest.3851c028b0cb.json.br +0 -0
- codex/static_root/manifest.3851c028b0cb.json.gz +0 -0
- {codex-1.6.0a11.dist-info → codex-1.6.0a12.dist-info}/LICENSE +0 -0
- {codex-1.6.0a11.dist-info → codex-1.6.0a12.dist-info}/WHEEL +0 -0
- {codex-1.6.0a11.dist-info → codex-1.6.0a12.dist-info}/entry_points.txt +0 -0
codex/librarian/covers/create.py
CHANGED
|
@@ -26,17 +26,17 @@ class CoverCreateMixin(CoverPathMixin):
|
|
|
26
26
|
@classmethod
|
|
27
27
|
def _create_cover_thumbnail(cls, cover_image_data):
|
|
28
28
|
"""Isolate the save thumbnail function for leak detection."""
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
cover_thumb_buffer = BytesIO()
|
|
30
|
+
with BytesIO(cover_image_data) as image_io:
|
|
31
|
+
with Image.open(image_io) as cover_image:
|
|
32
|
+
cover_image.thumbnail(
|
|
33
|
+
cls._THUMBNAIL_SIZE,
|
|
34
|
+
Image.Resampling.LANCZOS, # type: ignore
|
|
35
|
+
reducing_gap=3.0,
|
|
36
|
+
)
|
|
37
|
+
cover_image.save(cover_thumb_buffer, "WEBP", method=6)
|
|
38
|
+
cover_image.close() # extra close for animated sequences
|
|
39
|
+
return cover_thumb_buffer
|
|
40
40
|
|
|
41
41
|
@classmethod
|
|
42
42
|
def _get_comic_cover_image(cls, comic_path):
|
|
@@ -71,15 +71,18 @@ class CoverCreateMixin(CoverPathMixin):
|
|
|
71
71
|
cover_image = cls._get_custom_cover_image(db_path)
|
|
72
72
|
else:
|
|
73
73
|
cover_image = cls._get_comic_cover_image(db_path)
|
|
74
|
-
|
|
74
|
+
thumb_buffer = cls._create_cover_thumbnail(cover_image)
|
|
75
|
+
thumb_bytes = thumb_buffer.getvalue()
|
|
76
|
+
thumb_buffer.seek(0)
|
|
75
77
|
except Exception as exc:
|
|
76
|
-
|
|
78
|
+
thumb_bytes = b""
|
|
79
|
+
thumb_buffer = None
|
|
77
80
|
cover_str = db_path if db_path else f"{pk=}"
|
|
78
81
|
log.warning(f"Could not create cover thumbnail for {cover_str}: {exc}")
|
|
79
82
|
|
|
80
|
-
task = CoverSaveToCache(cover_path,
|
|
83
|
+
task = CoverSaveToCache(cover_path, thumb_bytes)
|
|
81
84
|
librarian_queue.put(task)
|
|
82
|
-
return
|
|
85
|
+
return thumb_buffer
|
|
83
86
|
|
|
84
87
|
def save_cover_to_cache(self, cover_path, data):
|
|
85
88
|
"""Save cover thumb image to the disk cache."""
|
|
@@ -110,9 +113,11 @@ class CoverCreateMixin(CoverPathMixin):
|
|
|
110
113
|
status.decrement_total()
|
|
111
114
|
else:
|
|
112
115
|
# bulk contributor creates covers inline
|
|
113
|
-
self.create_cover_from_path(
|
|
116
|
+
data = self.create_cover_from_path(
|
|
114
117
|
pk, cover_path, self.log, self.librarian_queue
|
|
115
118
|
)
|
|
119
|
+
if data:
|
|
120
|
+
data.close()
|
|
116
121
|
status.increment_complete()
|
|
117
122
|
self.status_controller.update(status)
|
|
118
123
|
|
|
@@ -4,22 +4,15 @@ from types import MappingProxyType
|
|
|
4
4
|
|
|
5
5
|
from rest_framework.fields import SerializerMethodField
|
|
6
6
|
from rest_framework.serializers import (
|
|
7
|
-
BooleanField,
|
|
8
7
|
CharField,
|
|
9
|
-
ChoiceField,
|
|
10
|
-
FloatField,
|
|
11
|
-
IntegerField,
|
|
12
8
|
Serializer,
|
|
13
9
|
)
|
|
14
10
|
from rest_framework.utils.serializer_helpers import ReturnList
|
|
15
11
|
|
|
16
12
|
from codex.serializers.browser.filters import BrowserSettingsFilterSerializer
|
|
17
13
|
from codex.serializers.fields import (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
DecadeListField,
|
|
21
|
-
FloatListField,
|
|
22
|
-
IntListField,
|
|
14
|
+
VuetifyCharField,
|
|
15
|
+
VuetifyIntegerField,
|
|
23
16
|
)
|
|
24
17
|
from codex.serializers.models.pycountry import CountrySerializer, LanguageSerializer
|
|
25
18
|
|
|
@@ -27,55 +20,24 @@ from codex.serializers.models.pycountry import CountrySerializer, LanguageSerial
|
|
|
27
20
|
class BrowserChoicesCharPkSerializer(Serializer):
|
|
28
21
|
"""Named Model Serializer."""
|
|
29
22
|
|
|
30
|
-
pk =
|
|
23
|
+
pk = VuetifyCharField(read_only=True)
|
|
31
24
|
name = CharField(read_only=True)
|
|
32
25
|
|
|
33
26
|
|
|
34
|
-
class
|
|
27
|
+
class BrowserChoicesIntegerPkSerializer(BrowserChoicesCharPkSerializer):
|
|
35
28
|
"""Named Model Serailizer with pk = char hack for languages & countries."""
|
|
36
29
|
|
|
37
|
-
pk =
|
|
30
|
+
pk = VuetifyIntegerField(read_only=True)
|
|
38
31
|
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
"""Named Model Serailizer with pk = char hack for languages & countries."""
|
|
42
|
-
|
|
43
|
-
pk = IntegerField(read_only=True)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class BrowserChoicesFloatPkSerializer(BrowserChoicesCharPkSerializer):
|
|
47
|
-
"""Named Model Serailizer with pk = char hack for languages & countries."""
|
|
48
|
-
|
|
49
|
-
pk = FloatField(read_only=True)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_CHOICES_TYPE_SERIALIZER_MAP = MappingProxyType(
|
|
33
|
+
_CHOICES_NAME_SERIALIZER_MAP = MappingProxyType(
|
|
53
34
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
DecadeListField: BrowserChoicesIntPkSerializer,
|
|
58
|
-
FloatListField: BrowserChoicesFloatPkSerializer,
|
|
59
|
-
IntListField: BrowserChoicesIntPkSerializer,
|
|
35
|
+
"bookmark": BrowserChoicesCharPkSerializer,
|
|
36
|
+
"country": CountrySerializer,
|
|
37
|
+
"language": LanguageSerializer,
|
|
60
38
|
}
|
|
61
39
|
)
|
|
62
|
-
|
|
63
|
-
{"country": CountrySerializer, "language": LanguageSerializer}
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def _create_choices_field_serializer_map():
|
|
68
|
-
serializer_map = {}
|
|
69
|
-
for name, field in BrowserSettingsFilterSerializer().fields.items(): # type: ignore
|
|
70
|
-
serializer_class = _CHOICES_NAME_SERIALIZER_MAP.get(name)
|
|
71
|
-
if not serializer_class:
|
|
72
|
-
serializer_class = _CHOICES_TYPE_SERIALIZER_MAP[field.__class__]
|
|
73
|
-
serializer_map[name] = serializer_class
|
|
74
|
-
|
|
75
|
-
return MappingProxyType(serializer_map)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_CHOICES_SERIALIZER_CLASS_MAP = _create_choices_field_serializer_map()
|
|
40
|
+
_LIST_FIELDS = frozenset({"decade", "monochrome", "reading_direction", "year"})
|
|
79
41
|
|
|
80
42
|
|
|
81
43
|
class BrowserChoicesFilterSerializer(Serializer):
|
|
@@ -85,10 +47,15 @@ class BrowserChoicesFilterSerializer(Serializer):
|
|
|
85
47
|
|
|
86
48
|
def get_choices(self, obj) -> ReturnList:
|
|
87
49
|
"""Dynamic Serializer response by field type."""
|
|
88
|
-
|
|
50
|
+
field_name = obj.get("field_name", "")
|
|
89
51
|
choices = obj.get("choices", [])
|
|
90
|
-
serializer_class =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
52
|
+
serializer_class = _CHOICES_NAME_SERIALIZER_MAP.get(field_name)
|
|
53
|
+
value: ReturnList
|
|
54
|
+
if serializer_class:
|
|
55
|
+
value = serializer_class(choices, many=True).data # type: ignore
|
|
56
|
+
elif not serializer_class and field_name in _LIST_FIELDS:
|
|
57
|
+
field = BrowserSettingsFilterSerializer().get_fields().get(field_name) # type: ignore
|
|
58
|
+
value = field.to_representation(choices)
|
|
59
|
+
else:
|
|
60
|
+
value = BrowserChoicesIntegerPkSerializer(choices, many=True).data # type: ignore
|
|
61
|
+
return value
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"""Browser Settings Filter Serializers."""
|
|
2
2
|
|
|
3
|
-
from rest_framework.serializers import
|
|
4
|
-
BooleanField,
|
|
5
|
-
ChoiceField,
|
|
6
|
-
Serializer,
|
|
7
|
-
)
|
|
3
|
+
from rest_framework.serializers import BooleanField, ListField, Serializer
|
|
8
4
|
|
|
9
|
-
from codex.serializers.choices import CHOICES
|
|
10
5
|
from codex.serializers.fields import (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
BookmarkFilterField,
|
|
7
|
+
VuetifyBooleanField,
|
|
8
|
+
VuetifyCharField,
|
|
9
|
+
VuetifyDecadeField,
|
|
10
|
+
VuetifyFloatField,
|
|
11
|
+
VuetifyIntegerField,
|
|
16
12
|
)
|
|
17
13
|
|
|
18
14
|
|
|
@@ -46,29 +42,27 @@ class BrowserFilterChoicesSerializer(Serializer):
|
|
|
46
42
|
class BrowserSettingsFilterSerializer(Serializer):
|
|
47
43
|
"""Filter values for settings."""
|
|
48
44
|
|
|
49
|
-
bookmark =
|
|
50
|
-
choices=tuple(CHOICES["bookmarkFilter"].keys()), required=False
|
|
51
|
-
)
|
|
45
|
+
bookmark = BookmarkFilterField(required=False)
|
|
52
46
|
# Dynamic filters
|
|
53
|
-
age_rating =
|
|
54
|
-
characters =
|
|
55
|
-
community_rating =
|
|
56
|
-
country =
|
|
57
|
-
contributors =
|
|
58
|
-
critical_rating =
|
|
59
|
-
decade =
|
|
60
|
-
file_type =
|
|
61
|
-
genres =
|
|
62
|
-
identifier_type =
|
|
63
|
-
language =
|
|
64
|
-
locations =
|
|
65
|
-
monochrome =
|
|
66
|
-
original_format =
|
|
67
|
-
reading_direction =
|
|
68
|
-
series_groups =
|
|
69
|
-
stories =
|
|
70
|
-
story_arcs =
|
|
71
|
-
tagger =
|
|
72
|
-
tags =
|
|
73
|
-
teams =
|
|
74
|
-
year =
|
|
47
|
+
age_rating = ListField(child=VuetifyCharField(), required=False)
|
|
48
|
+
characters = ListField(child=VuetifyIntegerField(), required=False)
|
|
49
|
+
community_rating = ListField(child=VuetifyFloatField(), required=False)
|
|
50
|
+
country = ListField(child=VuetifyIntegerField(), required=False)
|
|
51
|
+
contributors = ListField(child=VuetifyIntegerField(), required=False)
|
|
52
|
+
critical_rating = ListField(child=VuetifyFloatField(), required=False)
|
|
53
|
+
decade = ListField(child=VuetifyDecadeField(), required=False)
|
|
54
|
+
file_type = ListField(child=VuetifyCharField(), required=False)
|
|
55
|
+
genres = ListField(child=VuetifyIntegerField(), required=False)
|
|
56
|
+
identifier_type = ListField(child=VuetifyCharField(), required=False)
|
|
57
|
+
language = ListField(child=VuetifyIntegerField(), required=False)
|
|
58
|
+
locations = ListField(child=VuetifyIntegerField(), required=False)
|
|
59
|
+
monochrome = ListField(child=VuetifyBooleanField(), required=False)
|
|
60
|
+
original_format = ListField(child=VuetifyCharField(), required=False)
|
|
61
|
+
reading_direction = ListField(child=VuetifyCharField(), required=False)
|
|
62
|
+
series_groups = ListField(child=VuetifyIntegerField(), required=False)
|
|
63
|
+
stories = ListField(child=VuetifyIntegerField(), required=False)
|
|
64
|
+
story_arcs = ListField(child=VuetifyIntegerField(), required=False)
|
|
65
|
+
tagger = ListField(child=VuetifyCharField(), required=False)
|
|
66
|
+
tags = ListField(child=VuetifyIntegerField(), required=False)
|
|
67
|
+
teams = ListField(child=VuetifyIntegerField(), required=False)
|
|
68
|
+
year = ListField(child=VuetifyIntegerField(), required=False)
|
|
@@ -8,12 +8,12 @@ from rest_framework.serializers import (
|
|
|
8
8
|
DateTimeField,
|
|
9
9
|
DecimalField,
|
|
10
10
|
IntegerField,
|
|
11
|
+
ListField,
|
|
11
12
|
Serializer,
|
|
12
13
|
SerializerMethodField,
|
|
13
14
|
)
|
|
14
15
|
|
|
15
16
|
from codex.logger.logging import get_logger
|
|
16
|
-
from codex.serializers.browser.filters import IntListField
|
|
17
17
|
from codex.views.const import COMIC_GROUP, EPOCH_START
|
|
18
18
|
|
|
19
19
|
LOG = get_logger(__name__)
|
|
@@ -23,7 +23,7 @@ class BrowserAggregateSerializerMixin(Serializer):
|
|
|
23
23
|
"""Mixin for browser, opds & metadata serializers."""
|
|
24
24
|
|
|
25
25
|
group = CharField(read_only=True, max_length=1)
|
|
26
|
-
ids =
|
|
26
|
+
ids = ListField(child=IntegerField(), read_only=True)
|
|
27
27
|
|
|
28
28
|
# Aggregate Annotations
|
|
29
29
|
child_count = IntegerField(read_only=True)
|
codex/serializers/fields.py
CHANGED
|
@@ -6,7 +6,6 @@ from datetime import datetime, timezone
|
|
|
6
6
|
import pycountry
|
|
7
7
|
from django.core.exceptions import ValidationError
|
|
8
8
|
from django.utils.translation import gettext_lazy as _
|
|
9
|
-
from rest_framework.fields import Field
|
|
10
9
|
from rest_framework.serializers import (
|
|
11
10
|
BooleanField,
|
|
12
11
|
CharField,
|
|
@@ -38,93 +37,61 @@ class TimestampField(IntegerField):
|
|
|
38
37
|
return datetime.fromtimestamp(float(data) / 1000, tz=timezone.utc)
|
|
39
38
|
|
|
40
39
|
|
|
41
|
-
def
|
|
40
|
+
def validate_decade(decade):
|
|
42
41
|
"""Validate decades."""
|
|
43
|
-
if not decades:
|
|
44
|
-
return
|
|
45
42
|
# * We don't need a whole db call just to be perfectly accurate
|
|
46
43
|
# * -1s are decoded back into None before validation
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
exists = True
|
|
51
|
-
break
|
|
52
|
-
if not exists:
|
|
53
|
-
raise ValidationError(_(f"Invalid decade in: {decades}"))
|
|
44
|
+
if decade is not None and decade % 10 != 0:
|
|
45
|
+
raise ValidationError(_(f"Invalid decade: {decade}"))
|
|
46
|
+
return True
|
|
54
47
|
|
|
55
48
|
|
|
56
|
-
|
|
57
|
-
"""
|
|
49
|
+
class VuetifyNullCodeFieldMixin:
|
|
50
|
+
"""Convert Vuetify null codes to None."""
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
array index.
|
|
61
|
-
"""
|
|
62
|
-
for index, value in enumerate(values):
|
|
63
|
-
if value == VUETIFY_NULL_CODE:
|
|
64
|
-
values[index] = None
|
|
65
|
-
return values
|
|
52
|
+
NULL_CODE = VUETIFY_NULL_CODE
|
|
66
53
|
|
|
54
|
+
def to_internal_value(self, data):
|
|
55
|
+
"""Convert numeric null code to None."""
|
|
56
|
+
return None if data == self.NULL_CODE else data
|
|
67
57
|
|
|
68
|
-
def validate_str_null(values):
|
|
69
|
-
"""Use a special code for null.
|
|
70
58
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"""
|
|
74
|
-
for index, value in enumerate(values):
|
|
75
|
-
if value == VUETIFY_NULL_CODE_STR:
|
|
76
|
-
values[index] = None
|
|
77
|
-
return values
|
|
59
|
+
class VuetifyFloatField(VuetifyNullCodeFieldMixin, FloatField): # type: ignore
|
|
60
|
+
"""Float Field with null code conversion."""
|
|
78
61
|
|
|
79
62
|
|
|
80
|
-
class
|
|
81
|
-
"""
|
|
63
|
+
class VuetifyIntegerField(VuetifyNullCodeFieldMixin, IntegerField): # type: ignore
|
|
64
|
+
"""Integer Field with null code conversion."""
|
|
82
65
|
|
|
83
|
-
CHILD_CLASS = Field
|
|
84
|
-
VALIDATORS = ()
|
|
85
66
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
super().__init__(
|
|
89
|
-
*args,
|
|
90
|
-
child=self.CHILD_CLASS(allow_null=True, **kwargs),
|
|
91
|
-
required=False,
|
|
92
|
-
validators=self.VALIDATORS,
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class FloatListField(FilterListField):
|
|
97
|
-
"""Decimal List Field with validation."""
|
|
98
|
-
|
|
99
|
-
CHILD_CLASS = FloatField # type: ignore
|
|
100
|
-
VALIDATORS = (validate_int_null,)
|
|
67
|
+
class VuetifyCharField(VuetifyNullCodeFieldMixin, CharField): # type: ignore
|
|
68
|
+
"""Char Field with null code conversion."""
|
|
101
69
|
|
|
70
|
+
NULL_CODE = VUETIFY_NULL_CODE_STR
|
|
102
71
|
|
|
103
|
-
class IntListField(FilterListField):
|
|
104
|
-
"""Integer List Field with validation."""
|
|
105
72
|
|
|
106
|
-
|
|
107
|
-
|
|
73
|
+
class VuetifyBooleanField(VuetifyNullCodeFieldMixin, BooleanField): # type: ignore
|
|
74
|
+
"""Boolean Field with null code conversion."""
|
|
108
75
|
|
|
109
76
|
|
|
110
|
-
class
|
|
111
|
-
"""
|
|
77
|
+
class BookmarkFilterField(ChoiceField):
|
|
78
|
+
"""Bookmark Choice Field."""
|
|
112
79
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
80
|
+
def __init__(self, *args, **kwargs):
|
|
81
|
+
"""Use bookmark filter choices."""
|
|
82
|
+
super().__init__(
|
|
83
|
+
*args, choices=tuple(CHOICES["bookmarkFilter"].keys()), **kwargs
|
|
84
|
+
)
|
|
118
85
|
|
|
119
|
-
CHILD_CLASS = CharField # type: ignore
|
|
120
|
-
VALIDATORS = (validate_str_null,)
|
|
121
86
|
|
|
87
|
+
class VuetifyDecadeField(VuetifyIntegerField):
|
|
88
|
+
"""Integer field with null code conversion and decade validation."""
|
|
122
89
|
|
|
123
|
-
|
|
124
|
-
"""Bool List Field with validation."""
|
|
90
|
+
VALIDATORS = (validate_decade,)
|
|
125
91
|
|
|
126
|
-
|
|
127
|
-
|
|
92
|
+
def __init__(self, *args, **kwargs):
|
|
93
|
+
"""Use decade validator."""
|
|
94
|
+
super().__init__(*args, validators=self.VALIDATORS, **kwargs)
|
|
128
95
|
|
|
129
96
|
|
|
130
97
|
class BreadcrumbsField(ListField):
|
codex/serializers/opds/v2.py
CHANGED
|
@@ -11,8 +11,6 @@ from rest_framework.fields import (
|
|
|
11
11
|
)
|
|
12
12
|
from rest_framework.serializers import Serializer
|
|
13
13
|
|
|
14
|
-
from codex.serializers.fields import CharListField
|
|
15
|
-
|
|
16
14
|
|
|
17
15
|
class OPDS2LinkPropertiesSerializer(Serializer):
|
|
18
16
|
"""Link Properties.
|
|
@@ -51,9 +49,9 @@ class OPDS2LinkSerializer(Serializer):
|
|
|
51
49
|
width = IntegerField(read_only=True, required=False)
|
|
52
50
|
# bitrate = IntegerField(read_only=True, required=False)
|
|
53
51
|
# duration = IntegerField(read_only=True, required=False)
|
|
54
|
-
# language =
|
|
55
|
-
alternate =
|
|
56
|
-
children =
|
|
52
|
+
# language = CharField(many=True, read_only=True, required=False)
|
|
53
|
+
alternate = ListField(child=CharField(), read_only=True, required=False)
|
|
54
|
+
children = ListField(child=CharField(), read_only=True, required=False)
|
|
57
55
|
properties = OPDS2LinkPropertiesSerializer(read_only=True, required=False)
|
|
58
56
|
|
|
59
57
|
def get_rel(self, obj) -> str | None:
|
|
@@ -127,7 +125,7 @@ class OPDS2PublicationMetadataSerializer(OPDS2MetadataSerializer):
|
|
|
127
125
|
#####################
|
|
128
126
|
# Extended metadata #
|
|
129
127
|
#####################
|
|
130
|
-
subject =
|
|
128
|
+
subject = ListField(child=CharField(), read_only=True, required=False)
|
|
131
129
|
author = OPDS2ContributorObjectSerializer(many=True, required=False)
|
|
132
130
|
# translator = OPDS2ContributorObjectSerializer(many=True, required=False)
|
|
133
131
|
editor = OPDS2ContributorObjectSerializer(many=True, required=False)
|
codex/static_root/assets/{VCheckbox-BwDyxhU7.831b00df198a.js → VCheckbox-B3vCf1Vu.e1991f98ab6c.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as g,V as t}from"./VCheckboxBtn-
|
|
1
|
+
import{m as g,V as t}from"./VCheckboxBtn-Cj6bUYmw.js";import{a as A,u as B,V as l}from"./VSelectionControl-BOKIwNZb.js";import{E as I,ao as R,O as U,aw as w,F as D,h as E,R as M,cB as N,S as u,as as r}from"./admin-drawer-panel-BF-h3Wm0.js";const O=I({...A(),...R(g(),["inline"])},"VCheckbox"),q=U()({name:"VCheckbox",inheritAttrs:!1,props:O(),emits:{"update:modelValue":e=>!0,"update:focused":e=>!0},setup(e,c){let{attrs:d,slots:a}=c;const s=w(e,"modelValue"),{isFocused:n,focus:i,blur:m}=B(e),V=D(),p=E(()=>e.id||`checkbox-${V}`);return M(()=>{const[b,f]=N(d),v=l.filterProps(e),k=t.filterProps(e);return u(l,r({class:["v-checkbox",e.class]},b,v,{modelValue:s.value,"onUpdate:modelValue":o=>s.value=o,id:p.value,focused:n.value,style:e.style}),{...a,default:o=>{let{id:h,messagesId:x,isDisabled:P,isReadonly:C,isValid:y}=o;return u(t,r(k,{id:h.value,"aria-describedby":x.value,disabled:P.value,readonly:C.value},f,{error:y.value===!1,modelValue:s.value,"onUpdate:modelValue":F=>s.value=F,onFocus:i,onBlur:m}),a)}})}),{}}});export{q as V};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as g,V as t}from"./VCheckboxBtn-
|
|
1
|
+
import{m as g,V as t}from"./VCheckboxBtn-Cj6bUYmw.js";import{a as A,u as B,V as l}from"./VSelectionControl-BOKIwNZb.js";import{E as I,ao as R,O as U,aw as w,F as D,h as E,R as M,cB as N,S as u,as as r}from"./admin-drawer-panel-BF-h3Wm0.js";const O=I({...A(),...R(g(),["inline"])},"VCheckbox"),q=U()({name:"VCheckbox",inheritAttrs:!1,props:O(),emits:{"update:modelValue":e=>!0,"update:focused":e=>!0},setup(e,c){let{attrs:d,slots:a}=c;const s=w(e,"modelValue"),{isFocused:n,focus:i,blur:m}=B(e),V=D(),p=E(()=>e.id||`checkbox-${V}`);return M(()=>{const[b,f]=N(d),v=l.filterProps(e),k=t.filterProps(e);return u(l,r({class:["v-checkbox",e.class]},b,v,{modelValue:s.value,"onUpdate:modelValue":o=>s.value=o,id:p.value,focused:n.value,style:e.style}),{...a,default:o=>{let{id:h,messagesId:x,isDisabled:P,isReadonly:C,isValid:y}=o;return u(t,r(k,{id:h.value,"aria-describedby":x.value,disabled:P.value,readonly:C.value},f,{error:y.value===!1,modelValue:s.value,"onUpdate:modelValue":F=>s.value=F,onFocus:i,onBlur:m}),a)}})}),{}}});export{q as V};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,d as o}from"./VSelectionControl-
|
|
1
|
+
import{c as f,d as o}from"./VSelectionControl-BOKIwNZb.js";import{E as V,be as v,O as I,aw as c,h as l,R as h,ao as k,S as x,as as b}from"./admin-drawer-panel-BF-h3Wm0.js";const C=V({indeterminate:Boolean,indeterminateIcon:{type:v,default:"$checkboxIndeterminate"},...f({falseIcon:"$checkboxOff",trueIcon:"$checkboxOn"})},"VCheckboxBtn"),B=I()({name:"VCheckboxBtn",props:C(),emits:{"update:modelValue":e=>!0,"update:indeterminate":e=>!0},setup(e,r){let{slots:s}=r;const t=c(e,"indeterminate"),n=c(e,"modelValue");function u(a){t.value&&(t.value=!1)}const i=l(()=>t.value?e.indeterminateIcon:e.falseIcon),d=l(()=>t.value?e.indeterminateIcon:e.trueIcon);return h(()=>{const a=k(o.filterProps(e),["modelValue"]);return x(o,b(a,{modelValue:n.value,"onUpdate:modelValue":[m=>n.value=m,u],class:["v-checkbox-btn",e.class],style:e.style,type:"checkbox",falseIcon:i.value,trueIcon:d.value,"aria-checked":t.value?"mixed":void 0}),s)}),{}}});export{B as V,C as m};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,d as o}from"./VSelectionControl-
|
|
1
|
+
import{c as f,d as o}from"./VSelectionControl-BOKIwNZb.js";import{E as V,be as v,O as I,aw as c,h as l,R as h,ao as k,S as x,as as b}from"./admin-drawer-panel-BF-h3Wm0.js";const C=V({indeterminate:Boolean,indeterminateIcon:{type:v,default:"$checkboxIndeterminate"},...f({falseIcon:"$checkboxOff",trueIcon:"$checkboxOn"})},"VCheckboxBtn"),B=I()({name:"VCheckboxBtn",props:C(),emits:{"update:modelValue":e=>!0,"update:indeterminate":e=>!0},setup(e,r){let{slots:s}=r;const t=c(e,"indeterminate"),n=c(e,"modelValue");function u(a){t.value&&(t.value=!1)}const i=l(()=>t.value?e.indeterminateIcon:e.falseIcon),d=l(()=>t.value?e.indeterminateIcon:e.trueIcon);return h(()=>{const a=k(o.filterProps(e),["modelValue"]);return x(o,b(a,{modelValue:n.value,"onUpdate:modelValue":[m=>n.value=m,u],class:["v-checkbox-btn",e.class],style:e.style,type:"checkbox",falseIcon:i.value,trueIcon:d.value,"aria-checked":t.value?"mixed":void 0}),s)}),{}}});export{B as V,C as m};
|
|
Binary file
|
|
Binary file
|
codex/static_root/assets/{VCombobox-BASCOy0n.7801caa5e192.js → VCombobox-wIqJY8no.3547ff73e91e.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as Ce,u as ke,V as pe,a as we,b as Se}from"./VSelect-
|
|
1
|
+
import{m as Ce,u as ke,V as pe,a as we,b as Se}from"./VSelect-ou2Q9UaN.js";import{m as Fe,V as G}from"./VTextField-HAAxrpNi.js";import{E as Ie,ao as Pe,b3 as De,O as Re,bZ as Ae,r as N,s as P,aw as J,h as b,cN as _e,aq as Te,cO as D,a as R,n as X,ag as Ee,R as Me,S as i,U as O,as as I,bv as Ne,aY as ee,cP as Oe,aP as le,cQ as Le,bh as Ke,aj as Ue,cR as Be,at as je,cS as qe,cT as ze}from"./admin-drawer-panel-BF-h3Wm0.js";import{m as He,u as $e}from"./filter-BOnVoHTU.js";import{g as Qe}from"./VSelectionControl-BOKIwNZb.js";import{V as We}from"./VCheckboxBtn-Cj6bUYmw.js";function Ye(e,g,A){if(g==null)return e;if(Array.isArray(g))throw new Error("Multiple matches is not implemented");return typeof g=="number"&&~g?i(O,null,[i("span",{class:"v-combobox__unmask"},[e.substr(0,g)]),i("span",{class:"v-combobox__mask"},[e.substr(g,A)]),i("span",{class:"v-combobox__unmask"},[e.substr(g+A)])]):e}const Ze=Ie({autoSelectFirst:{type:[Boolean,String]},clearOnSelect:{type:Boolean,default:!0},delimiters:Array,...He({filterKeys:["title"]}),...Ce({hideNoData:!0,returnObject:!0}),...Pe(Fe({modelValue:null,role:"combobox"}),["validationValue","dirty","appendInnerIcon"]),...De({transition:!1})},"VCombobox"),tl=Re()({name:"VCombobox",props:Ze(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:search":e=>!0,"update:menu":e=>!0},setup(e,g){var W;let{emit:A,slots:o}=g;const{t:L}=Ae(),V=N(),x=P(!1),C=P(!0),K=P(!1),H=N(),$=N(),U=J(e,"menu"),c=b({get:()=>U.value,set:l=>{var t;U.value&&!l&&((t=H.value)!=null&&t.ΨopenChildren)||(U.value=l)}}),s=P(-1);let B=!1;const ae=b(()=>{var l;return(l=V.value)==null?void 0:l.color}),Q=b(()=>c.value?e.closeText:e.openText),{items:te,transformIn:ne,transformOut:ue}=_e(e),{textColorClasses:oe,textColorStyles:ie}=Te(ae),n=J(e,"modelValue",[],l=>ne(ze(l)),l=>{const t=ue(l);return e.multiple?t:t[0]??null}),F=Qe(),_=b(()=>!!(e.chips||o.chip)),y=b(()=>_.value||!!o.selection),k=P(!e.multiple&&!y.value?((W=n.value[0])==null?void 0:W.title)??"":""),v=b({get:()=>k.value,set:l=>{var t;if(k.value=l??"",!e.multiple&&!y.value&&(n.value=[D(e,l)]),l&&e.multiple&&((t=e.delimiters)!=null&&t.length)){const r=l.split(new RegExp(`(?:${e.delimiters.join("|")})+`));r.length>1&&(r.forEach(a=>{a=a.trim(),a&&h(D(e,a))}),k.value="")}l||(s.value=-1),C.value=!l}}),se=b(()=>typeof e.counterValue=="function"?e.counterValue(n.value):typeof e.counterValue=="number"?e.counterValue:e.multiple?n.value.length:v.value.length);R(k,l=>{B?X(()=>B=!1):x.value&&!c.value&&(c.value=!0),A("update:search",l)}),R(n,l=>{var t;!e.multiple&&!y.value&&(k.value=((t=l[0])==null?void 0:t.title)??"")});const{filteredItems:T,getMatches:re}=$e(e,te,()=>C.value?"":v.value),p=b(()=>e.hideSelected?T.value.filter(l=>!n.value.some(t=>t.value===l.value)):T.value),ce=b(()=>n.value.map(l=>l.value)),j=b(()=>{var t;return(e.autoSelectFirst===!0||e.autoSelectFirst==="exact"&&v.value===((t=p.value[0])==null?void 0:t.title))&&p.value.length>0&&!C.value&&!K.value}),q=b(()=>e.hideNoData&&!p.value.length||e.readonly||(F==null?void 0:F.isReadonly.value)),z=N(),{onListScroll:ve,onListKeydown:de}=ke(z,V);function fe(l){B=!0,e.openOnClear&&(c.value=!0)}function me(){q.value||(c.value=!0)}function be(l){q.value||(x.value&&(l.preventDefault(),l.stopPropagation()),c.value=!c.value)}function he(l){var a;if(qe(l)||e.readonly||F!=null&&F.isReadonly.value)return;const t=V.value.selectionStart,r=n.value.length;if((s.value>-1||["Enter","ArrowDown","ArrowUp"].includes(l.key))&&l.preventDefault(),["Enter","ArrowDown"].includes(l.key)&&(c.value=!0),["Escape"].includes(l.key)&&(c.value=!1),["Enter","Escape","Tab"].includes(l.key)&&(j.value&&["Enter","Tab"].includes(l.key)&&!n.value.some(u=>{let{value:m}=u;return m===p.value[0].value})&&h(T.value[0]),C.value=!0),l.key==="ArrowDown"&&j.value&&((a=z.value)==null||a.focus("next")),l.key==="Enter"&&v.value&&(h(D(e,v.value)),y.value&&(k.value="")),["Backspace","Delete"].includes(l.key)){if(!e.multiple&&y.value&&n.value.length>0&&!v.value)return h(n.value[0],!1);if(~s.value){const u=s.value;h(n.value[s.value],!1),s.value=u>=r-1?r-2:u}else l.key==="Backspace"&&!v.value&&(s.value=r-1)}if(e.multiple){if(l.key==="ArrowLeft"){if(s.value<0&&t>0)return;const u=s.value>-1?s.value-1:r-1;n.value[u]?s.value=u:(s.value=-1,V.value.setSelectionRange(v.value.length,v.value.length))}if(l.key==="ArrowRight"){if(s.value<0)return;const u=s.value+1;n.value[u]?s.value=u:(s.value=-1,V.value.setSelectionRange(0,0))}}}function ge(){var l;x.value&&(C.value=!0,(l=V.value)==null||l.focus())}function h(l){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!(!l||l.props.disabled))if(e.multiple){const r=n.value.findIndex(u=>e.valueComparator(u.value,l.value)),a=t??!~r;if(~r){const u=a?[...n.value,l]:[...n.value];u.splice(r,1),n.value=u}else a&&(n.value=[...n.value,l]);e.clearOnSelect&&(v.value="")}else{const r=t!==!1;n.value=r?[l]:[],k.value=r&&!y.value?l.title:"",X(()=>{c.value=!1,C.value=!0})}}function xe(l){x.value=!0,setTimeout(()=>{K.value=!0})}function ye(l){K.value=!1}function Ve(l){(l==null||l===""&&!e.multiple&&!y.value)&&(n.value=[])}return R(x,(l,t)=>{if(!(l||l===t)&&(s.value=-1,c.value=!1,v.value)){if(e.multiple){h(D(e,v.value));return}if(!y.value)return;n.value.some(r=>{let{title:a}=r;return a===v.value})?k.value="":h(D(e,v.value))}}),R(c,()=>{if(!e.hideSelected&&c.value&&n.value.length){const l=p.value.findIndex(t=>n.value.some(r=>e.valueComparator(r.value,t.value)));Ee&&window.requestAnimationFrame(()=>{var t;l>=0&&((t=$.value)==null||t.scrollToIndex(l))})}}),R(()=>e.items,(l,t)=>{c.value||x.value&&!t.length&&l.length&&(c.value=!0)}),Me(()=>{const l=!!(!e.hideNoData||p.value.length||o["prepend-item"]||o["append-item"]||o["no-data"]),t=n.value.length>0,r=G.filterProps(e);return i(G,I({ref:V},r,{modelValue:v.value,"onUpdate:modelValue":[a=>v.value=a,Ve],focused:x.value,"onUpdate:focused":a=>x.value=a,validationValue:n.externalValue,counterValue:se.value,dirty:t,class:["v-combobox",{"v-combobox--active-menu":c.value,"v-combobox--chips":!!e.chips,"v-combobox--selection-slot":!!y.value,"v-combobox--selecting-index":s.value>-1,[`v-combobox--${e.multiple?"multiple":"single"}`]:!0},e.class],style:e.style,readonly:e.readonly,placeholder:t?void 0:e.placeholder,"onClick:clear":fe,"onMousedown:control":me,onKeydown:he}),{...o,default:()=>i(O,null,[i(pe,I({ref:H,modelValue:c.value,"onUpdate:modelValue":a=>c.value=a,activator:"parent",contentClass:"v-combobox__content",disabled:q.value,eager:e.eager,maxHeight:310,openOnClick:!1,closeOnContentClick:!1,transition:e.transition,onAfterLeave:ge},e.menuProps),{default:()=>[l&&i(Ne,I({ref:z,selected:ce.value,selectStrategy:e.multiple?"independent":"single-independent",onMousedown:a=>a.preventDefault(),onKeydown:de,onFocusin:xe,onFocusout:ye,onScrollPassive:ve,tabindex:"-1","aria-live":"polite",color:e.itemColor??e.color},e.listProps),{default:()=>{var a,u,m;return[(a=o["prepend-item"])==null?void 0:a.call(o),!p.value.length&&!e.hideNoData&&(((u=o["no-data"])==null?void 0:u.call(o))??i(ee,{title:L(e.noDataText)},null)),i(we,{ref:$,renderless:!0,items:p.value},{default:w=>{var Z;let{item:d,index:S,itemRef:f}=w;const Y=I(d.props,{ref:f,key:S,active:j.value&&S===0?!0:void 0,onClick:()=>h(d,null)});return((Z=o.item)==null?void 0:Z.call(o,{item:d,index:S,props:Y}))??i(ee,I(Y,{role:"option"}),{prepend:E=>{let{isSelected:M}=E;return i(O,null,[e.multiple&&!e.hideSelected?i(We,{key:d.value,modelValue:M,ripple:!1,tabindex:"-1"},null):void 0,d.props.prependAvatar&&i(Oe,{image:d.props.prependAvatar},null),d.props.prependIcon&&i(le,{icon:d.props.prependIcon},null)])},title:()=>{var E,M;return C.value?d.title:Ye(d.title,(E=re(d))==null?void 0:E.title,((M=v.value)==null?void 0:M.length)??0)}})}}),(m=o["append-item"])==null?void 0:m.call(o)]}})]}),n.value.map((a,u)=>{function m(f){f.stopPropagation(),f.preventDefault(),h(a,!1)}const w={"onClick:close":m,onKeydown(f){f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),f.stopPropagation(),m(f))},onMousedown(f){f.preventDefault(),f.stopPropagation()},modelValue:!0,"onUpdate:modelValue":void 0},d=_.value?!!o.chip:!!o.selection,S=d?Le(_.value?o.chip({item:a,index:u,props:w}):o.selection({item:a,index:u})):void 0;if(!(d&&!S))return i("div",{key:a.value,class:["v-combobox__selection",u===s.value&&["v-combobox__selection--selected",oe.value]],style:u===s.value?ie.value:{}},[_.value?o.chip?i(Ke,{key:"chip-defaults",defaults:{VChip:{closable:e.closableChips,size:"small",text:a.title}}},{default:()=>[S]}):i(Se,I({key:"chip",closable:e.closableChips,size:"small",text:a.title,disabled:a.props.disabled},w),null):S??i("span",{class:"v-combobox__selection-text"},[a.title,e.multiple&&u<n.value.length-1&&i("span",{class:"v-combobox__selection-comma"},[Ue(",")])])])})]),"append-inner":function(){var w;for(var a=arguments.length,u=new Array(a),m=0;m<a;m++)u[m]=arguments[m];return i(O,null,[(w=o["append-inner"])==null?void 0:w.call(o,...u),(!e.hideNoData||e.items.length)&&e.menuIcon?i(le,{class:"v-combobox__menu-icon",icon:e.menuIcon,onMousedown:be,onClick:Be,"aria-label":L(Q.value),title:L(Q.value),tabindex:"-1"},null):void 0])}})}),je({isFocused:x,isPristine:C,menu:c,search:v,selectionIndex:s,filteredItems:T,select:h},V)}});export{tl as V};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as Ce,u as ke,V as pe,a as we,b as Se}from"./VSelect-
|
|
1
|
+
import{m as Ce,u as ke,V as pe,a as we,b as Se}from"./VSelect-ou2Q9UaN.js";import{m as Fe,V as G}from"./VTextField-HAAxrpNi.js";import{E as Ie,ao as Pe,b3 as De,O as Re,bZ as Ae,r as N,s as P,aw as J,h as b,cN as _e,aq as Te,cO as D,a as R,n as X,ag as Ee,R as Me,S as i,U as O,as as I,bv as Ne,aY as ee,cP as Oe,aP as le,cQ as Le,bh as Ke,aj as Ue,cR as Be,at as je,cS as qe,cT as ze}from"./admin-drawer-panel-BF-h3Wm0.js";import{m as He,u as $e}from"./filter-BOnVoHTU.js";import{g as Qe}from"./VSelectionControl-BOKIwNZb.js";import{V as We}from"./VCheckboxBtn-Cj6bUYmw.js";function Ye(e,g,A){if(g==null)return e;if(Array.isArray(g))throw new Error("Multiple matches is not implemented");return typeof g=="number"&&~g?i(O,null,[i("span",{class:"v-combobox__unmask"},[e.substr(0,g)]),i("span",{class:"v-combobox__mask"},[e.substr(g,A)]),i("span",{class:"v-combobox__unmask"},[e.substr(g+A)])]):e}const Ze=Ie({autoSelectFirst:{type:[Boolean,String]},clearOnSelect:{type:Boolean,default:!0},delimiters:Array,...He({filterKeys:["title"]}),...Ce({hideNoData:!0,returnObject:!0}),...Pe(Fe({modelValue:null,role:"combobox"}),["validationValue","dirty","appendInnerIcon"]),...De({transition:!1})},"VCombobox"),tl=Re()({name:"VCombobox",props:Ze(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:search":e=>!0,"update:menu":e=>!0},setup(e,g){var W;let{emit:A,slots:o}=g;const{t:L}=Ae(),V=N(),x=P(!1),C=P(!0),K=P(!1),H=N(),$=N(),U=J(e,"menu"),c=b({get:()=>U.value,set:l=>{var t;U.value&&!l&&((t=H.value)!=null&&t.ΨopenChildren)||(U.value=l)}}),s=P(-1);let B=!1;const ae=b(()=>{var l;return(l=V.value)==null?void 0:l.color}),Q=b(()=>c.value?e.closeText:e.openText),{items:te,transformIn:ne,transformOut:ue}=_e(e),{textColorClasses:oe,textColorStyles:ie}=Te(ae),n=J(e,"modelValue",[],l=>ne(ze(l)),l=>{const t=ue(l);return e.multiple?t:t[0]??null}),F=Qe(),_=b(()=>!!(e.chips||o.chip)),y=b(()=>_.value||!!o.selection),k=P(!e.multiple&&!y.value?((W=n.value[0])==null?void 0:W.title)??"":""),v=b({get:()=>k.value,set:l=>{var t;if(k.value=l??"",!e.multiple&&!y.value&&(n.value=[D(e,l)]),l&&e.multiple&&((t=e.delimiters)!=null&&t.length)){const r=l.split(new RegExp(`(?:${e.delimiters.join("|")})+`));r.length>1&&(r.forEach(a=>{a=a.trim(),a&&h(D(e,a))}),k.value="")}l||(s.value=-1),C.value=!l}}),se=b(()=>typeof e.counterValue=="function"?e.counterValue(n.value):typeof e.counterValue=="number"?e.counterValue:e.multiple?n.value.length:v.value.length);R(k,l=>{B?X(()=>B=!1):x.value&&!c.value&&(c.value=!0),A("update:search",l)}),R(n,l=>{var t;!e.multiple&&!y.value&&(k.value=((t=l[0])==null?void 0:t.title)??"")});const{filteredItems:T,getMatches:re}=$e(e,te,()=>C.value?"":v.value),p=b(()=>e.hideSelected?T.value.filter(l=>!n.value.some(t=>t.value===l.value)):T.value),ce=b(()=>n.value.map(l=>l.value)),j=b(()=>{var t;return(e.autoSelectFirst===!0||e.autoSelectFirst==="exact"&&v.value===((t=p.value[0])==null?void 0:t.title))&&p.value.length>0&&!C.value&&!K.value}),q=b(()=>e.hideNoData&&!p.value.length||e.readonly||(F==null?void 0:F.isReadonly.value)),z=N(),{onListScroll:ve,onListKeydown:de}=ke(z,V);function fe(l){B=!0,e.openOnClear&&(c.value=!0)}function me(){q.value||(c.value=!0)}function be(l){q.value||(x.value&&(l.preventDefault(),l.stopPropagation()),c.value=!c.value)}function he(l){var a;if(qe(l)||e.readonly||F!=null&&F.isReadonly.value)return;const t=V.value.selectionStart,r=n.value.length;if((s.value>-1||["Enter","ArrowDown","ArrowUp"].includes(l.key))&&l.preventDefault(),["Enter","ArrowDown"].includes(l.key)&&(c.value=!0),["Escape"].includes(l.key)&&(c.value=!1),["Enter","Escape","Tab"].includes(l.key)&&(j.value&&["Enter","Tab"].includes(l.key)&&!n.value.some(u=>{let{value:m}=u;return m===p.value[0].value})&&h(T.value[0]),C.value=!0),l.key==="ArrowDown"&&j.value&&((a=z.value)==null||a.focus("next")),l.key==="Enter"&&v.value&&(h(D(e,v.value)),y.value&&(k.value="")),["Backspace","Delete"].includes(l.key)){if(!e.multiple&&y.value&&n.value.length>0&&!v.value)return h(n.value[0],!1);if(~s.value){const u=s.value;h(n.value[s.value],!1),s.value=u>=r-1?r-2:u}else l.key==="Backspace"&&!v.value&&(s.value=r-1)}if(e.multiple){if(l.key==="ArrowLeft"){if(s.value<0&&t>0)return;const u=s.value>-1?s.value-1:r-1;n.value[u]?s.value=u:(s.value=-1,V.value.setSelectionRange(v.value.length,v.value.length))}if(l.key==="ArrowRight"){if(s.value<0)return;const u=s.value+1;n.value[u]?s.value=u:(s.value=-1,V.value.setSelectionRange(0,0))}}}function ge(){var l;x.value&&(C.value=!0,(l=V.value)==null||l.focus())}function h(l){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!(!l||l.props.disabled))if(e.multiple){const r=n.value.findIndex(u=>e.valueComparator(u.value,l.value)),a=t??!~r;if(~r){const u=a?[...n.value,l]:[...n.value];u.splice(r,1),n.value=u}else a&&(n.value=[...n.value,l]);e.clearOnSelect&&(v.value="")}else{const r=t!==!1;n.value=r?[l]:[],k.value=r&&!y.value?l.title:"",X(()=>{c.value=!1,C.value=!0})}}function xe(l){x.value=!0,setTimeout(()=>{K.value=!0})}function ye(l){K.value=!1}function Ve(l){(l==null||l===""&&!e.multiple&&!y.value)&&(n.value=[])}return R(x,(l,t)=>{if(!(l||l===t)&&(s.value=-1,c.value=!1,v.value)){if(e.multiple){h(D(e,v.value));return}if(!y.value)return;n.value.some(r=>{let{title:a}=r;return a===v.value})?k.value="":h(D(e,v.value))}}),R(c,()=>{if(!e.hideSelected&&c.value&&n.value.length){const l=p.value.findIndex(t=>n.value.some(r=>e.valueComparator(r.value,t.value)));Ee&&window.requestAnimationFrame(()=>{var t;l>=0&&((t=$.value)==null||t.scrollToIndex(l))})}}),R(()=>e.items,(l,t)=>{c.value||x.value&&!t.length&&l.length&&(c.value=!0)}),Me(()=>{const l=!!(!e.hideNoData||p.value.length||o["prepend-item"]||o["append-item"]||o["no-data"]),t=n.value.length>0,r=G.filterProps(e);return i(G,I({ref:V},r,{modelValue:v.value,"onUpdate:modelValue":[a=>v.value=a,Ve],focused:x.value,"onUpdate:focused":a=>x.value=a,validationValue:n.externalValue,counterValue:se.value,dirty:t,class:["v-combobox",{"v-combobox--active-menu":c.value,"v-combobox--chips":!!e.chips,"v-combobox--selection-slot":!!y.value,"v-combobox--selecting-index":s.value>-1,[`v-combobox--${e.multiple?"multiple":"single"}`]:!0},e.class],style:e.style,readonly:e.readonly,placeholder:t?void 0:e.placeholder,"onClick:clear":fe,"onMousedown:control":me,onKeydown:he}),{...o,default:()=>i(O,null,[i(pe,I({ref:H,modelValue:c.value,"onUpdate:modelValue":a=>c.value=a,activator:"parent",contentClass:"v-combobox__content",disabled:q.value,eager:e.eager,maxHeight:310,openOnClick:!1,closeOnContentClick:!1,transition:e.transition,onAfterLeave:ge},e.menuProps),{default:()=>[l&&i(Ne,I({ref:z,selected:ce.value,selectStrategy:e.multiple?"independent":"single-independent",onMousedown:a=>a.preventDefault(),onKeydown:de,onFocusin:xe,onFocusout:ye,onScrollPassive:ve,tabindex:"-1","aria-live":"polite",color:e.itemColor??e.color},e.listProps),{default:()=>{var a,u,m;return[(a=o["prepend-item"])==null?void 0:a.call(o),!p.value.length&&!e.hideNoData&&(((u=o["no-data"])==null?void 0:u.call(o))??i(ee,{title:L(e.noDataText)},null)),i(we,{ref:$,renderless:!0,items:p.value},{default:w=>{var Z;let{item:d,index:S,itemRef:f}=w;const Y=I(d.props,{ref:f,key:S,active:j.value&&S===0?!0:void 0,onClick:()=>h(d,null)});return((Z=o.item)==null?void 0:Z.call(o,{item:d,index:S,props:Y}))??i(ee,I(Y,{role:"option"}),{prepend:E=>{let{isSelected:M}=E;return i(O,null,[e.multiple&&!e.hideSelected?i(We,{key:d.value,modelValue:M,ripple:!1,tabindex:"-1"},null):void 0,d.props.prependAvatar&&i(Oe,{image:d.props.prependAvatar},null),d.props.prependIcon&&i(le,{icon:d.props.prependIcon},null)])},title:()=>{var E,M;return C.value?d.title:Ye(d.title,(E=re(d))==null?void 0:E.title,((M=v.value)==null?void 0:M.length)??0)}})}}),(m=o["append-item"])==null?void 0:m.call(o)]}})]}),n.value.map((a,u)=>{function m(f){f.stopPropagation(),f.preventDefault(),h(a,!1)}const w={"onClick:close":m,onKeydown(f){f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),f.stopPropagation(),m(f))},onMousedown(f){f.preventDefault(),f.stopPropagation()},modelValue:!0,"onUpdate:modelValue":void 0},d=_.value?!!o.chip:!!o.selection,S=d?Le(_.value?o.chip({item:a,index:u,props:w}):o.selection({item:a,index:u})):void 0;if(!(d&&!S))return i("div",{key:a.value,class:["v-combobox__selection",u===s.value&&["v-combobox__selection--selected",oe.value]],style:u===s.value?ie.value:{}},[_.value?o.chip?i(Ke,{key:"chip-defaults",defaults:{VChip:{closable:e.closableChips,size:"small",text:a.title}}},{default:()=>[S]}):i(Se,I({key:"chip",closable:e.closableChips,size:"small",text:a.title,disabled:a.props.disabled},w),null):S??i("span",{class:"v-combobox__selection-text"},[a.title,e.multiple&&u<n.value.length-1&&i("span",{class:"v-combobox__selection-comma"},[Ue(",")])])])})]),"append-inner":function(){var w;for(var a=arguments.length,u=new Array(a),m=0;m<a;m++)u[m]=arguments[m];return i(O,null,[(w=o["append-inner"])==null?void 0:w.call(o,...u),(!e.hideNoData||e.items.length)&&e.menuIcon?i(le,{class:"v-combobox__menu-icon",icon:e.menuIcon,onMousedown:be,onClick:Be,"aria-label":L(Q.value),title:L(Q.value),tabindex:"-1"},null):void 0])}})}),je({isFocused:x,isPristine:C,menu:c,search:v,selectionIndex:s,filteredItems:T,select:h},V)}});export{tl as V};
|
|
Binary file
|
|
Binary file
|