smoothly 1.0.0-alpha.98 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Data-50d47740.js +589 -0
- package/dist/cjs/Data-50d47740.js.map +1 -0
- package/dist/cjs/Observers-6450f075.js +25 -0
- package/dist/cjs/Observers-6450f075.js.map +1 -0
- package/dist/cjs/TimeZone-016ac7b0.js +6181 -0
- package/dist/cjs/TimeZone-016ac7b0.js.map +1 -0
- package/dist/cjs/{getLanguage-7e53766b.js → getLanguage-49a534df.js} +1 -5993
- package/dist/cjs/getLanguage-49a534df.js.map +1 -0
- package/dist/cjs/{index-6ae370b4.js → index-43af753b.js} +1 -4
- package/dist/cjs/index-43af753b.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -14
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/smoothly-accordion-item.cjs.entry.js +61 -0
- package/dist/cjs/smoothly-accordion-item.cjs.entry.js.map +1 -0
- package/dist/cjs/smoothly-accordion.cjs.entry.js +58 -0
- package/dist/cjs/smoothly-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/smoothly-address-display.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-address.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-addresses.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-app_80.cjs.entry.js +11148 -0
- package/dist/cjs/smoothly-app_80.cjs.entry.js.map +1 -0
- package/dist/cjs/smoothly-checkbox.cjs.entry.js +102 -0
- package/dist/cjs/smoothly-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/smoothly-color.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-country.cjs.entry.js +56 -55
- package/dist/cjs/smoothly-country.cjs.entry.js.map +1 -1
- package/dist/cjs/smoothly-display-date-time.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-reorder.cjs.entry.js +4 -4
- package/dist/cjs/smoothly-reorder.cjs.entry.js.map +1 -1
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -2
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -2
- package/dist/cjs/smoothly.cjs.js +4 -3
- package/dist/cjs/smoothly.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +24 -7
- package/dist/collection/components/Button.js +16 -2
- package/dist/collection/components/Button.js.map +1 -1
- package/dist/collection/components/app/index.js +53 -1
- package/dist/collection/components/app/index.js.map +1 -1
- package/dist/collection/components/app/room/index.js +47 -4
- package/dist/collection/components/app/room/index.js.map +1 -1
- package/dist/collection/components/app/room/style.css +25 -8
- package/dist/collection/components/app/style.css +57 -32
- package/dist/collection/components/app-demo/index.js +1 -2
- package/dist/collection/components/app-demo/index.js.map +1 -1
- package/dist/collection/components/burger/index.js +9 -9
- package/dist/collection/components/burger/index.js.map +1 -1
- package/dist/collection/components/button/index.js +9 -22
- package/dist/collection/components/button/index.js.map +1 -1
- package/dist/collection/components/button/style.css +23 -20
- package/dist/collection/components/button-demo/index.js +3 -1
- package/dist/collection/components/button-demo/index.js.map +1 -1
- package/dist/collection/components/button-demo/style.css +1 -0
- package/dist/collection/components/calendar/generate.js +1 -1
- package/dist/collection/components/calendar/generate.js.map +1 -1
- package/dist/collection/components/calendar/index.js +16 -16
- package/dist/collection/components/calendar/index.js.map +1 -1
- package/dist/collection/components/checkbox/index.js +60 -29
- package/dist/collection/components/checkbox/index.js.map +1 -1
- package/dist/collection/components/checkbox/style.css +39 -42
- package/dist/collection/components/confirm/index.js +261 -0
- package/dist/collection/components/confirm/index.js.map +1 -0
- package/dist/collection/components/confirm/style.css +15 -0
- package/dist/collection/components/display/index.js +4 -1
- package/dist/collection/components/display/index.js.map +1 -1
- package/dist/collection/components/display-demo/index.js +16 -1
- package/dist/collection/components/display-demo/index.js.map +1 -1
- package/dist/collection/components/filter/Filter.js +17 -0
- package/dist/collection/components/filter/Filter.js.map +1 -0
- package/dist/collection/components/filter/field/index.js +105 -0
- package/dist/collection/components/filter/field/index.js.map +1 -0
- package/dist/collection/components/filter/field/style.css +4 -0
- package/dist/collection/components/filter/index.js +55 -132
- package/dist/collection/components/filter/index.js.map +1 -1
- package/dist/collection/components/filter/input/index.js +84 -301
- package/dist/collection/components/filter/input/index.js.map +1 -1
- package/dist/collection/components/filter/picker/index.js +229 -0
- package/dist/collection/components/filter/picker/index.js.map +1 -0
- package/dist/collection/components/filter/picker/style.css +8 -0
- package/dist/collection/components/filter/style.css +56 -71
- package/dist/collection/components/filter/toggle/index.js +248 -0
- package/dist/collection/components/filter/toggle/index.js.map +1 -0
- package/dist/collection/components/filter/toggle/style.css +8 -0
- package/dist/collection/components/form/index.js +234 -66
- package/dist/collection/components/form/index.js.map +1 -1
- package/dist/collection/components/form/style.css +3 -1
- package/dist/collection/components/icon/index.js +60 -32
- package/dist/collection/components/icon/index.js.map +1 -1
- package/dist/collection/components/icon/style.css +15 -0
- package/dist/collection/components/icon-demo/index.js +3 -1
- package/dist/collection/components/icon-demo/index.js.map +1 -1
- package/dist/collection/components/icon-demo/style.css +5 -6
- package/dist/collection/components/input/Editable.js +19 -0
- package/dist/collection/components/input/Editable.js.map +1 -0
- package/dist/collection/components/input/Input.js +22 -1
- package/dist/collection/components/input/Input.js.map +1 -1
- package/dist/collection/components/input/Looks.js +7 -1
- package/dist/collection/components/input/Looks.js.map +1 -1
- package/dist/collection/components/input/Submittable.js.map +1 -1
- package/dist/collection/components/input/checkbox/index.js +382 -0
- package/dist/collection/components/input/checkbox/index.js.map +1 -0
- package/dist/collection/components/input/checkbox/style.css +75 -0
- package/dist/collection/components/input/clear/index.js +12 -7
- package/dist/collection/components/input/clear/index.js.map +1 -1
- package/dist/collection/components/input/clear/style.css +23 -20
- package/dist/collection/components/input/color/index.js +226 -0
- package/dist/collection/components/input/color/index.js.map +1 -0
- package/dist/collection/components/input/color/style.css +15 -0
- package/dist/collection/components/input/date/index.js +8 -8
- package/dist/collection/components/input/date/index.js.map +1 -1
- package/dist/collection/components/input/date/range/index.js +13 -17
- package/dist/collection/components/input/date/range/index.js.map +1 -1
- package/dist/collection/components/input/date/range/style.css +25 -0
- package/dist/collection/components/input/date/style.css +25 -0
- package/dist/collection/components/input/demo/index.js +28 -72
- package/dist/collection/components/input/demo/index.js.map +1 -1
- package/dist/collection/components/input/demo/style.css +15 -0
- package/dist/collection/components/input/edit/index.js +249 -0
- package/dist/collection/components/input/edit/index.js.map +1 -0
- package/dist/collection/components/input/edit/style.css +238 -0
- package/dist/collection/components/input/file/index.js +3 -3
- package/dist/collection/components/input/file/index.js.map +1 -1
- package/dist/collection/components/input/file/style.css +22 -0
- package/dist/collection/components/input/index.js +245 -110
- package/dist/collection/components/input/index.js.map +1 -1
- package/dist/collection/components/input/month/index.js +5 -5
- package/dist/collection/components/input/month/index.js.map +1 -1
- package/dist/collection/components/input/radio/Selected.js +11 -0
- package/dist/collection/components/input/radio/Selected.js.map +1 -0
- package/dist/collection/components/input/radio/index.js +426 -0
- package/dist/collection/components/input/radio/index.js.map +1 -0
- package/dist/collection/components/{radio-button → input/radio/item}/index.js +60 -72
- package/dist/collection/components/input/radio/item/index.js.map +1 -0
- package/dist/collection/components/input/radio/item/style.css +28 -0
- package/dist/collection/components/input/radio/style.css +66 -0
- package/dist/collection/components/input/range/index.js +440 -0
- package/dist/collection/components/input/range/index.js.map +1 -0
- package/dist/collection/components/input/range/style.css +154 -0
- package/dist/collection/components/input/reset/index.js +260 -0
- package/dist/collection/components/input/reset/index.js.map +1 -0
- package/dist/collection/components/input/reset/style.css +255 -0
- package/dist/collection/components/input/select/index.js +443 -95
- package/dist/collection/components/input/select/index.js.map +1 -1
- package/dist/collection/components/input/select/style.css +111 -23
- package/dist/collection/components/input/style.css +24 -2
- package/dist/collection/components/input/submit/index.js +269 -0
- package/dist/collection/components/input/submit/index.js.map +1 -0
- package/dist/collection/components/input/submit/style.css +11 -0
- package/dist/collection/components/item/Item.js +11 -0
- package/dist/collection/components/item/Item.js.map +1 -0
- package/dist/collection/components/item/index.js +69 -29
- package/dist/collection/components/item/index.js.map +1 -1
- package/dist/collection/components/item/style.css +1 -3
- package/dist/collection/components/label/index.js +81 -0
- package/dist/collection/components/label/index.js.map +1 -0
- package/dist/collection/components/label/style.css +15 -0
- package/dist/collection/components/lazy/index.js +73 -0
- package/dist/collection/components/lazy/index.js.map +1 -0
- package/dist/collection/components/{radio → load-more}/index.js +35 -46
- package/dist/collection/components/load-more/index.js.map +1 -0
- package/dist/collection/components/load-more/style.css +5 -0
- package/dist/collection/components/notification/index.js.map +1 -1
- package/dist/collection/components/picker/demo/index.js +17 -15
- package/dist/collection/components/picker/demo/index.js.map +1 -1
- package/dist/collection/components/picker/demo/style.css +24 -1
- package/dist/collection/components/picker/index.js +172 -7
- package/dist/collection/components/picker/index.js.map +1 -1
- package/dist/collection/components/picker/menu/index.js +74 -3
- package/dist/collection/components/picker/menu/index.js.map +1 -1
- package/dist/collection/components/picker/menu/style.css +16 -6
- package/dist/collection/components/picker/option/index.js +51 -3
- package/dist/collection/components/picker/option/index.js.map +1 -1
- package/dist/collection/components/picker/option/style.css +9 -4
- package/dist/collection/components/picker/style.css +28 -3
- package/dist/collection/components/popup/index.js +5 -5
- package/dist/collection/components/popup/index.js.map +1 -1
- package/dist/collection/components/popup/style.css +4 -4
- package/dist/collection/components/submit/index.js +0 -15
- package/dist/collection/components/submit/index.js.map +1 -1
- package/dist/collection/components/submit/style.css +23 -20
- package/dist/collection/components/summary/index.js +2 -3
- package/dist/collection/components/summary/index.js.map +1 -1
- package/dist/collection/components/summary/style.css +25 -16
- package/dist/collection/components/table/cell/style.css +3 -3
- package/dist/collection/components/table/demo/filtered/Root.js.map +1 -1
- package/dist/collection/components/table/demo/filtered/index.js +30 -15
- package/dist/collection/components/table/demo/filtered/index.js.map +1 -1
- package/dist/collection/components/table/demo/filtered/style.css +9 -0
- package/dist/collection/components/table/demo/index.js +2 -14
- package/dist/collection/components/table/demo/index.js.map +1 -1
- package/dist/collection/components/table/demo/style.css +5 -0
- package/dist/collection/components/table/demo/testing/data.js.map +1 -0
- package/dist/collection/components/table/demo/testing/index.js +28 -0
- package/dist/collection/components/table/demo/testing/index.js.map +1 -0
- package/dist/collection/components/table/demo/testing/style.css +32 -0
- package/dist/collection/components/table/expandable/cell/index.js +1 -20
- package/dist/collection/components/table/expandable/cell/index.js.map +1 -1
- package/dist/collection/components/table/expandable/cell/style.css +13 -13
- package/dist/collection/components/table/expandable/row/index.js +1 -20
- package/dist/collection/components/table/expandable/row/index.js.map +1 -1
- package/dist/collection/components/table/expandable/row/style.css +11 -11
- package/dist/collection/components/table/footer/index.js +19 -0
- package/dist/collection/components/table/footer/index.js.map +1 -0
- package/dist/collection/components/table/footer/style.css +10 -0
- package/dist/collection/components/table/header/style.css +2 -3
- package/dist/collection/components/table/index.js +24 -1
- package/dist/collection/components/table/index.js.map +1 -1
- package/dist/collection/components/theme/color/index.js +48 -0
- package/dist/collection/components/theme/color/index.js.map +1 -0
- package/dist/collection/components/theme/color/style.css +8 -0
- package/dist/collection/components/theme/color/variant/index.js +66 -0
- package/dist/collection/components/theme/color/variant/index.js.map +1 -0
- package/dist/collection/components/theme/color/variant/style.css +18 -0
- package/dist/collection/components/theme/colors/index.js +30 -0
- package/dist/collection/components/theme/colors/index.js.map +1 -0
- package/dist/collection/components/theme/colors/style.css +7 -0
- package/dist/collection/components/theme/picker/index.js +48 -0
- package/dist/collection/components/theme/picker/index.js.map +1 -0
- package/dist/collection/components/theme/picker/style.css +0 -0
- package/dist/collection/components/toggle-switch/index.js +69 -17
- package/dist/collection/components/toggle-switch/index.js.map +1 -1
- package/dist/collection/components/toggle-switch/style.css +19 -12
- package/dist/collection/global/Observers.js +22 -0
- package/dist/collection/global/Observers.js.map +1 -0
- package/dist/collection/global/index.js +5 -0
- package/dist/collection/global/index.js.map +1 -0
- package/dist/collection/model/Color.js +18 -1
- package/dist/collection/model/Color.js.map +1 -1
- package/dist/collection/model/Data.js +8 -1
- package/dist/collection/model/Data.js.map +1 -1
- package/dist/collection/model/Icon.js +23 -0
- package/dist/collection/model/Icon.js.map +1 -0
- package/dist/collection/model/Listenable.js +16 -3
- package/dist/collection/model/Listenable.js.map +1 -1
- package/dist/collection/model/Option.js.map +1 -1
- package/dist/collection/model/index.js +2 -1
- package/dist/collection/model/index.js.map +1 -1
- package/dist/collection/smoothly.js +1 -1
- package/dist/collection/smoothly.js.map +1 -1
- package/dist/custom-elements/index.d.ts +120 -24
- package/dist/custom-elements/index.js +15445 -33845
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/Data-c8093b5a.js +579 -0
- package/dist/esm/Data-c8093b5a.js.map +1 -0
- package/dist/esm/Observers-5f08e828.js +25 -0
- package/dist/esm/Observers-5f08e828.js.map +1 -0
- package/dist/esm/TimeZone-c8df4905.js +6181 -0
- package/dist/esm/TimeZone-c8df4905.js.map +1 -0
- package/dist/esm/{getLanguage-9c833eef.js → getLanguage-1e9ec036.js} +2 -5994
- package/dist/esm/getLanguage-1e9ec036.js.map +1 -0
- package/dist/esm/{index-c196715a.js → index-258984d3.js} +2 -4
- package/dist/esm/index-258984d3.js.map +1 -0
- package/dist/esm/index.js +3 -14
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/smoothly-accordion-item.entry.js +57 -0
- package/dist/esm/smoothly-accordion-item.entry.js.map +1 -0
- package/dist/esm/smoothly-accordion.entry.js +54 -0
- package/dist/esm/smoothly-accordion.entry.js.map +1 -0
- package/dist/esm/smoothly-address-display.entry.js +1 -1
- package/dist/esm/smoothly-address.entry.js +1 -1
- package/dist/esm/smoothly-addresses.entry.js +1 -1
- package/dist/esm/smoothly-app_80.entry.js +11065 -0
- package/dist/esm/smoothly-app_80.entry.js.map +1 -0
- package/dist/esm/smoothly-checkbox.entry.js +98 -0
- package/dist/esm/smoothly-checkbox.entry.js.map +1 -0
- package/dist/esm/smoothly-color.entry.js +1 -1
- package/dist/esm/smoothly-country.entry.js +10 -9
- package/dist/esm/smoothly-country.entry.js.map +1 -1
- package/dist/esm/smoothly-display-date-time.entry.js +1 -1
- package/dist/esm/smoothly-google-font.entry.js +1 -1
- package/dist/esm/smoothly-reorder.entry.js +2 -2
- package/dist/esm/smoothly-reorder.entry.js.map +1 -1
- package/dist/esm/smoothly-trigger-sink.entry.js +2 -2
- package/dist/esm/smoothly-trigger-source.entry.js +2 -2
- package/dist/esm/smoothly.js +5 -4
- package/dist/esm/smoothly.js.map +1 -1
- package/dist/smoothly/index.esm.js +1 -1
- package/dist/smoothly/index.esm.js.map +1 -1
- package/dist/smoothly/{p-663ccbd0.entry.js → p-12182a73.entry.js} +2 -2
- package/dist/smoothly/p-21905b32.entry.js +2 -0
- package/dist/smoothly/p-21905b32.entry.js.map +1 -0
- package/dist/smoothly/p-2e986022.js +2 -0
- package/dist/smoothly/p-2e986022.js.map +1 -0
- package/dist/smoothly/p-303520d1.entry.js +2 -0
- package/dist/smoothly/p-303520d1.entry.js.map +1 -0
- package/dist/smoothly/p-312ef066.js +2 -0
- package/dist/smoothly/p-312ef066.js.map +1 -0
- package/dist/smoothly/{p-9992c8c4.entry.js → p-47151a53.entry.js} +2 -2
- package/dist/smoothly/{p-d0b8061e.js → p-5e387578.js} +3 -3
- package/dist/smoothly/p-5e387578.js.map +1 -0
- package/dist/smoothly/{p-b82ef190.entry.js → p-635c813e.entry.js} +2 -2
- package/dist/smoothly/{p-dbd1afa9.entry.js → p-6aebb818.entry.js} +2 -2
- package/dist/smoothly/p-6e9aca2e.entry.js +2 -0
- package/dist/smoothly/p-6e9aca2e.entry.js.map +1 -0
- package/dist/smoothly/{p-c4ffc15d.entry.js → p-7a69b43f.entry.js} +2 -2
- package/dist/smoothly/{p-4d743f07.entry.js → p-7bf147bf.entry.js} +2 -2
- package/dist/smoothly/p-823e02b0.entry.js +2 -0
- package/dist/smoothly/p-823e02b0.entry.js.map +1 -0
- package/dist/smoothly/p-b3eac6af.entry.js +2 -0
- package/dist/smoothly/{p-4ff439dd.entry.js.map → p-b3eac6af.entry.js.map} +1 -1
- package/dist/smoothly/{p-f96e41aa.entry.js → p-cb493516.entry.js} +2 -2
- package/dist/smoothly/p-ede93d69.js +2 -0
- package/dist/smoothly/p-ede93d69.js.map +1 -0
- package/dist/smoothly/{p-ce4e6f44.entry.js → p-eef1c80b.entry.js} +2 -2
- package/dist/smoothly/p-f125610c.entry.js +2 -0
- package/dist/smoothly/p-f125610c.entry.js.map +1 -0
- package/dist/smoothly/p-fa664317.js +2 -0
- package/dist/smoothly/p-fa664317.js.map +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/smoothly/smoothly.esm.js.map +1 -1
- package/dist/types/components/Button.d.ts +1 -2
- package/dist/types/components/app/index.d.ts +3 -0
- package/dist/types/components/app/room/index.d.ts +4 -2
- package/dist/types/components/app-demo/index.d.ts +1 -0
- package/dist/types/components/burger/index.d.ts +2 -2
- package/dist/types/components/button/index.d.ts +2 -2
- package/dist/types/components/calendar/index.d.ts +5 -5
- package/dist/types/components/checkbox/index.d.ts +4 -2
- package/dist/types/components/confirm/index.d.ts +19 -0
- package/dist/types/components/filter/Filter.d.ts +21 -0
- package/dist/types/components/filter/field/index.d.ts +10 -0
- package/dist/types/components/filter/index.d.ts +13 -12
- package/dist/types/components/filter/input/index.d.ts +17 -23
- package/dist/types/components/filter/picker/index.d.ts +25 -0
- package/dist/types/components/filter/toggle/index.d.ts +22 -0
- package/dist/types/components/form/index.d.ts +22 -15
- package/dist/types/components/icon/index.d.ts +4 -6
- package/dist/types/components/input/Editable.d.ts +21 -0
- package/dist/types/components/input/Input.d.ts +19 -7
- package/dist/types/components/input/Looks.d.ts +7 -1
- package/dist/types/components/input/Submittable.d.ts +1 -1
- package/dist/types/components/input/checkbox/index.d.ts +30 -0
- package/dist/types/components/input/color/index.d.ts +24 -0
- package/dist/types/components/input/date/index.d.ts +1 -1
- package/dist/types/components/input/date/range/index.d.ts +2 -2
- package/dist/types/components/input/demo/index.d.ts +3 -6
- package/dist/types/components/input/edit/index.d.ts +18 -0
- package/dist/types/components/input/index.d.ts +30 -21
- package/dist/types/components/input/month/index.d.ts +1 -1
- package/dist/types/components/input/radio/Selected.d.ts +10 -0
- package/dist/types/components/input/radio/index.d.ts +36 -0
- package/dist/types/components/input/radio/item/index.d.ts +15 -0
- package/dist/types/components/input/range/index.d.ts +33 -0
- package/dist/types/components/input/reset/index.d.ts +19 -0
- package/dist/types/components/input/select/index.d.ts +41 -18
- package/dist/types/components/input/submit/index.d.ts +19 -0
- package/dist/types/components/item/Item.d.ts +10 -0
- package/dist/types/components/item/index.d.ts +8 -5
- package/dist/types/components/label/index.d.ts +6 -0
- package/dist/types/components/lazy/index.d.ts +7 -0
- package/dist/types/components/load-more/index.d.ts +11 -0
- package/dist/types/components/picker/demo/index.d.ts +7 -2
- package/dist/types/components/picker/index.d.ts +20 -6
- package/dist/types/components/picker/menu/index.d.ts +8 -0
- package/dist/types/components/picker/option/index.d.ts +2 -0
- package/dist/types/components/popup/index.d.ts +1 -1
- package/dist/types/components/submit/index.d.ts +0 -1
- package/dist/types/components/table/demo/filtered/Root.d.ts +2 -0
- package/dist/types/components/table/demo/filtered/index.d.ts +6 -6
- package/dist/types/components/table/demo/index.d.ts +1 -1
- package/dist/types/components/table/expandable/cell/index.d.ts +0 -1
- package/dist/types/components/table/expandable/row/index.d.ts +0 -1
- package/dist/types/components/table/footer/index.d.ts +3 -0
- package/dist/types/components/table/index.d.ts +2 -0
- package/dist/types/components/theme/color/index.d.ts +5 -0
- package/dist/types/components/theme/color/variant/index.d.ts +6 -0
- package/dist/types/components/theme/colors/index.d.ts +3 -0
- package/dist/types/components/theme/picker/index.d.ts +4 -0
- package/dist/types/components/toggle-switch/index.d.ts +7 -2
- package/dist/types/components.d.ts +658 -182
- package/dist/types/global/Observers.d.ts +8 -0
- package/dist/types/global/index.d.ts +4 -0
- package/dist/types/model/Color.d.ts +7 -1
- package/dist/types/model/Data.d.ts +4 -0
- package/dist/types/model/Icon.d.ts +8 -0
- package/dist/types/model/Listenable.d.ts +10 -1
- package/dist/types/model/Option.d.ts +2 -0
- package/dist/types/model/index.d.ts +1 -1
- package/dist/types/smoothly.d.ts +1 -1
- package/package.json +7 -11
- package/dist/cjs/Data-afbe461d.js +0 -807
- package/dist/cjs/Data-afbe461d.js.map +0 -1
- package/dist/cjs/getLanguage-7e53766b.js.map +0 -1
- package/dist/cjs/index-6ae370b4.js.map +0 -1
- package/dist/cjs/smoothly-accordion_66.cjs.entry.js +0 -29732
- package/dist/cjs/smoothly-accordion_66.cjs.entry.js.map +0 -1
- package/dist/cjs/smoothly-radio-group.cjs.entry.js +0 -22
- package/dist/cjs/smoothly-radio-group.cjs.entry.js.map +0 -1
- package/dist/collection/components/filter/Clearable.js +0 -8
- package/dist/collection/components/filter/Clearable.js.map +0 -1
- package/dist/collection/components/icon/Icon.js +0 -2
- package/dist/collection/components/icon/Icon.js.map +0 -1
- package/dist/collection/components/input/Changeable.js +0 -8
- package/dist/collection/components/input/Changeable.js.map +0 -1
- package/dist/collection/components/radio/index.js.map +0 -1
- package/dist/collection/components/radio/style.css +0 -31
- package/dist/collection/components/radio-button/Selected.js +0 -2
- package/dist/collection/components/radio-button/Selected.js.map +0 -1
- package/dist/collection/components/radio-button/index.js.map +0 -1
- package/dist/collection/components/radio-button/item/index.js +0 -117
- package/dist/collection/components/radio-button/item/index.js.map +0 -1
- package/dist/collection/components/radio-button/item/style.css +0 -85
- package/dist/collection/components/radio-group/index.js +0 -43
- package/dist/collection/components/radio-group/index.js.map +0 -1
- package/dist/collection/components/radio-group/style.css +0 -36
- package/dist/collection/components/table/testing/data.js.map +0 -1
- package/dist/collection/components/table/testing/index.js +0 -28
- package/dist/collection/components/table/testing/index.js.map +0 -1
- package/dist/collection/components/table/testing/style.css +0 -8
- package/dist/collection/model/ClientIdentifier.js +0 -13
- package/dist/collection/model/ClientIdentifier.js.map +0 -1
- package/dist/esm/Data-77d2bdbe.js +0 -803
- package/dist/esm/Data-77d2bdbe.js.map +0 -1
- package/dist/esm/getLanguage-9c833eef.js.map +0 -1
- package/dist/esm/index-c196715a.js.map +0 -1
- package/dist/esm/smoothly-accordion_66.entry.js +0 -29663
- package/dist/esm/smoothly-accordion_66.entry.js.map +0 -1
- package/dist/esm/smoothly-radio-group.entry.js +0 -18
- package/dist/esm/smoothly-radio-group.entry.js.map +0 -1
- package/dist/smoothly/p-1b714a63.js +0 -2
- package/dist/smoothly/p-1b714a63.js.map +0 -1
- package/dist/smoothly/p-1efa3261.entry.js +0 -2
- package/dist/smoothly/p-1efa3261.entry.js.map +0 -1
- package/dist/smoothly/p-4ff439dd.entry.js +0 -2
- package/dist/smoothly/p-74a3586c.js +0 -2
- package/dist/smoothly/p-74a3586c.js.map +0 -1
- package/dist/smoothly/p-8a45ae84.entry.js +0 -2
- package/dist/smoothly/p-8a45ae84.entry.js.map +0 -1
- package/dist/smoothly/p-a245e37d.entry.js +0 -2
- package/dist/smoothly/p-a245e37d.entry.js.map +0 -1
- package/dist/smoothly/p-d0b8061e.js.map +0 -1
- package/dist/types/components/filter/Clearable.d.ts +0 -6
- package/dist/types/components/icon/Icon.d.ts +0 -4
- package/dist/types/components/input/Changeable.d.ts +0 -7
- package/dist/types/components/radio/index.d.ts +0 -13
- package/dist/types/components/radio-button/Selected.d.ts +0 -5
- package/dist/types/components/radio-button/index.d.ts +0 -13
- package/dist/types/components/radio-button/item/index.d.ts +0 -12
- package/dist/types/components/radio-group/index.d.ts +0 -4
- package/dist/types/model/ClientIdentifier.d.ts +0 -5
- /package/dist/collection/components/{radio-button → lazy}/style.css +0 -0
- /package/dist/collection/components/table/{testing → demo/testing}/data.js +0 -0
- /package/dist/smoothly/{p-663ccbd0.entry.js.map → p-12182a73.entry.js.map} +0 -0
- /package/dist/smoothly/{p-9992c8c4.entry.js.map → p-47151a53.entry.js.map} +0 -0
- /package/dist/smoothly/{p-b82ef190.entry.js.map → p-635c813e.entry.js.map} +0 -0
- /package/dist/smoothly/{p-dbd1afa9.entry.js.map → p-6aebb818.entry.js.map} +0 -0
- /package/dist/smoothly/{p-c4ffc15d.entry.js.map → p-7a69b43f.entry.js.map} +0 -0
- /package/dist/smoothly/{p-4d743f07.entry.js.map → p-7bf147bf.entry.js.map} +0 -0
- /package/dist/smoothly/{p-f96e41aa.entry.js.map → p-cb493516.entry.js.map} +0 -0
- /package/dist/smoothly/{p-ce4e6f44.entry.js.map → p-eef1c80b.entry.js.map} +0 -0
- /package/dist/types/components/table/{testing → demo/testing}/data.d.ts +0 -0
- /package/dist/types/components/table/{testing → demo/testing}/index.d.ts +0 -0
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class Type {
|
|
4
|
+
get name() {
|
|
5
|
+
return typeof this._name == "function" ? this._name() : this._name;
|
|
6
|
+
}
|
|
7
|
+
get condition() {
|
|
8
|
+
return typeof this._condition == "function" ? this._condition() : this._condition;
|
|
9
|
+
}
|
|
10
|
+
optional() {
|
|
11
|
+
return new IslyOptional(this);
|
|
12
|
+
}
|
|
13
|
+
readonly() {
|
|
14
|
+
return new IslyReadonly(this);
|
|
15
|
+
}
|
|
16
|
+
array(...options) {
|
|
17
|
+
return array(this, ...options);
|
|
18
|
+
}
|
|
19
|
+
constructor(_name, _condition) {
|
|
20
|
+
this._name = _name;
|
|
21
|
+
this._condition = _condition;
|
|
22
|
+
/**
|
|
23
|
+
* Return the value if the value is valid for the type, otherwise undefined.
|
|
24
|
+
* For objects, unknown properties are filtered.
|
|
25
|
+
*
|
|
26
|
+
* Eg: isly.number().value(NaN) returns undefined
|
|
27
|
+
*/
|
|
28
|
+
this.get = value => (this.is(value) ? this.getValue(value) : undefined);
|
|
29
|
+
/**
|
|
30
|
+
* Return a flaw object, describing the flaws of the value compared to expected type.
|
|
31
|
+
*
|
|
32
|
+
* If it is a correct value, according to the type, it returns a Flaw with the message `{message:"This type is correct.", isFlaw: false, ... }`
|
|
33
|
+
*
|
|
34
|
+
* Implemented as a closure.
|
|
35
|
+
*/
|
|
36
|
+
this.flaw = value => {
|
|
37
|
+
return this.is(value)
|
|
38
|
+
? {
|
|
39
|
+
type: this.name,
|
|
40
|
+
...(this.condition ? { condition: this.condition } : undefined),
|
|
41
|
+
isFlaw: false,
|
|
42
|
+
message: "This type is correct.",
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
...(this.condition ? { condition: this.condition } : undefined),
|
|
46
|
+
...this.createFlaw(value),
|
|
47
|
+
type: this.name,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
getValue(value) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Override this to create custom Flaws.
|
|
56
|
+
* Not necessary for simple types.
|
|
57
|
+
*/
|
|
58
|
+
createFlaw(value) {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Used by types that use a backend type.
|
|
63
|
+
*/
|
|
64
|
+
createFlawFromType(backend, value) {
|
|
65
|
+
return "createFlaw" in backend && typeof backend.createFlaw == "function"
|
|
66
|
+
? backend.createFlaw(value)
|
|
67
|
+
: backend.flaw(value);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
class IslyOptional extends Type {
|
|
71
|
+
constructor(backend) {
|
|
72
|
+
super(() => backend.name + " | undefined", backend.condition);
|
|
73
|
+
this.backend = backend;
|
|
74
|
+
this.is = (value => value == undefined || this.backend.is(value));
|
|
75
|
+
}
|
|
76
|
+
createFlaw(value) {
|
|
77
|
+
return this.createFlawFromType(this.backend, value);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
class IslyReadonly extends Type {
|
|
81
|
+
constructor(backend) {
|
|
82
|
+
super(() => `Readonly<${backend.name}>`, backend.condition);
|
|
83
|
+
this.backend = backend;
|
|
84
|
+
this.is = (value => value == undefined || this.backend.is(value));
|
|
85
|
+
}
|
|
86
|
+
createFlaw(value) {
|
|
87
|
+
return this.createFlawFromType(this.backend, value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function array(itemType, ...options) {
|
|
91
|
+
return new IslyArray(itemType, options);
|
|
92
|
+
}
|
|
93
|
+
const criteriaFunctions$1 = {
|
|
94
|
+
length: {
|
|
95
|
+
is: (value, optionValue) => value.length == optionValue,
|
|
96
|
+
condition: optionValue => `length == ${optionValue}`,
|
|
97
|
+
},
|
|
98
|
+
minLength: {
|
|
99
|
+
is: (value, optionValue) => value.length >= optionValue,
|
|
100
|
+
condition: optionValue => `minLength == ${optionValue}`,
|
|
101
|
+
},
|
|
102
|
+
maxLength: {
|
|
103
|
+
is: (value, optionValue) => value.length <= optionValue,
|
|
104
|
+
condition: optionValue => `maxLength == ${optionValue}`,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
class IslyArray extends Type {
|
|
108
|
+
constructor(itemType, options) {
|
|
109
|
+
super(() => this.baseName() + "[]", options.length > 0 ? options.map(c => criteriaFunctions$1[c.criteria].condition(c.value)).join(" & ") : undefined);
|
|
110
|
+
this.itemType = itemType;
|
|
111
|
+
this.options = options;
|
|
112
|
+
this.is = (value => globalThis.Array.isArray(value) &&
|
|
113
|
+
this.options.every(option => criteriaFunctions$1[option.criteria].is(value, option.value)) &&
|
|
114
|
+
value.every(item => this.itemType.is(item)));
|
|
115
|
+
}
|
|
116
|
+
baseName() {
|
|
117
|
+
return this.itemType.name.includes(" ") ? `(${this.itemType.name})` : this.itemType.name;
|
|
118
|
+
}
|
|
119
|
+
itemName(index) {
|
|
120
|
+
return `${this.baseName()}[${index}]`;
|
|
121
|
+
}
|
|
122
|
+
createFlaw(value) {
|
|
123
|
+
const flaws = (globalThis.Array.isArray(value) &&
|
|
124
|
+
value.flatMap((item, index) => {
|
|
125
|
+
const subFlaw = this.itemType.flaw(item);
|
|
126
|
+
return subFlaw.isFlaw ?? true ? [{ ...subFlaw, type: this.itemName(index) }] : [];
|
|
127
|
+
})) ||
|
|
128
|
+
[];
|
|
129
|
+
return {
|
|
130
|
+
...(flaws.length > 0 ? { flaws } : undefined),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
getValue(value) {
|
|
134
|
+
return value.map(item => this.itemType.get(item));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
class IslyBoolean extends Type {
|
|
139
|
+
constructor(booleanValue) {
|
|
140
|
+
super(booleanValue == undefined ? "boolean" : booleanValue ? "true" : "false");
|
|
141
|
+
this.booleanValue = booleanValue;
|
|
142
|
+
this.is = (value => typeof value == "boolean" && (this.booleanValue == undefined || value == this.booleanValue));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function boolean(booleanValue) {
|
|
146
|
+
return new IslyBoolean(booleanValue);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
class IslyLazy extends Type {
|
|
150
|
+
constructor(factory, name) {
|
|
151
|
+
super(name ?? (() => (this.backend ??= factory()).name), () => (this.backend ??= factory()).condition);
|
|
152
|
+
this.factory = factory;
|
|
153
|
+
this.is = (value => (this.backend ??= this.factory()).is(value));
|
|
154
|
+
this.get = value => this.backend.get(value);
|
|
155
|
+
}
|
|
156
|
+
createFlaw(value) {
|
|
157
|
+
return this.createFlawFromType((this.backend ??= this.factory()), value);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Late evaluation of a type
|
|
162
|
+
* Can be used for for recursive types.
|
|
163
|
+
*
|
|
164
|
+
* @param factory
|
|
165
|
+
* @param name Provide a name, to avoid infinite loop if the type i recursive
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
168
|
+
function lazy(factory, name) {
|
|
169
|
+
return new IslyLazy(factory, name);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
class IslyObject extends Type {
|
|
173
|
+
constructor(baseType, properties, name) {
|
|
174
|
+
super(() => name ??
|
|
175
|
+
(this.baseType ? `${this.baseType.name} & ` : "") +
|
|
176
|
+
`{${globalThis.Object.entries(this.properties)
|
|
177
|
+
.map(([property, type]) => `${property}: ${type.name}`)
|
|
178
|
+
.join(", ")}}`);
|
|
179
|
+
this.baseType = baseType;
|
|
180
|
+
this.properties = properties;
|
|
181
|
+
this.is = (value => !!(value &&
|
|
182
|
+
(this.baseType == undefined || this.baseType.is(value)) &&
|
|
183
|
+
typeof value == "object" &&
|
|
184
|
+
!globalThis.Array.isArray(value) &&
|
|
185
|
+
globalThis.Object.entries(this.properties).every(([property, type]) => type.is(value[property]))));
|
|
186
|
+
}
|
|
187
|
+
extend(properties, name) {
|
|
188
|
+
return new IslyObject(this, properties, name);
|
|
189
|
+
}
|
|
190
|
+
omit(omits, name) {
|
|
191
|
+
return new IslyObject(this.baseType?.omit(omits), globalThis.Object.fromEntries(globalThis.Object.entries(this.properties).filter(([key]) => !omits.includes(key))), name ?? `Omit<${this.name}, ${omits.map(key => `"${String(key)}"`).join(" | ")}>`);
|
|
192
|
+
}
|
|
193
|
+
pick(picks, name) {
|
|
194
|
+
return new IslyObject(this.baseType?.pick(picks), globalThis.Object.fromEntries(globalThis.Object.entries(this.properties).filter(([key]) => picks.includes(key))), name ?? `Pick<${this.name}, ${picks.map(key => `"${String(key)}"`).join(" | ")}>`);
|
|
195
|
+
}
|
|
196
|
+
createFlaw(value) {
|
|
197
|
+
return {
|
|
198
|
+
flaws: [
|
|
199
|
+
this.baseType ? this.baseType.flaw(value)?.flaws ?? [] : [],
|
|
200
|
+
globalThis.Object.entries(this.properties)
|
|
201
|
+
.map(([property, type]) => [property, type.flaw(value?.[property])])
|
|
202
|
+
.map(([property, flaw]) => (flaw?.isFlaw ?? true) && { property, ...flaw })
|
|
203
|
+
.filter(flaw => flaw),
|
|
204
|
+
]
|
|
205
|
+
.flat()
|
|
206
|
+
.filter(flaw => flaw?.isFlaw ?? true),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* get-function on a object returns a object with only specified properties
|
|
211
|
+
*/
|
|
212
|
+
getValue(value) {
|
|
213
|
+
const result = this.baseType ? this.baseType.getValue(value) : {};
|
|
214
|
+
if (result)
|
|
215
|
+
for (const [key, type] of globalThis.Object.entries(this.properties))
|
|
216
|
+
if (key in value)
|
|
217
|
+
result[key] = type.get(value[key]);
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function object(properties, name) {
|
|
222
|
+
return new IslyObject(undefined, properties ?? {}, name);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
class IslyString extends Type {
|
|
226
|
+
constructor(stringCondition) {
|
|
227
|
+
super(typeof stringCondition == "string" ? `"${stringCondition}"` : "string", () => {
|
|
228
|
+
const conditionObject = this.getConditionObject();
|
|
229
|
+
return conditionObject instanceof RegExp
|
|
230
|
+
? `/${conditionObject.source}/${conditionObject.flags}`
|
|
231
|
+
: globalThis.Object.keys(conditionObject)
|
|
232
|
+
.map(key => `"${key}"`)
|
|
233
|
+
.join(" | ");
|
|
234
|
+
});
|
|
235
|
+
this.stringCondition = stringCondition;
|
|
236
|
+
this.is = (value => {
|
|
237
|
+
const conditionObject = this.getConditionObject();
|
|
238
|
+
return (typeof value == "string" &&
|
|
239
|
+
(conditionObject instanceof RegExp
|
|
240
|
+
? conditionObject.test(value)
|
|
241
|
+
: typeof conditionObject == "object"
|
|
242
|
+
? value in conditionObject //TODO, avoid "hasOwnProperty toString etc."
|
|
243
|
+
: conditionObject));
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
getConditionObject() {
|
|
247
|
+
return (this.conditionObject ??= Array.isArray(this.stringCondition)
|
|
248
|
+
? this.stringCondition.reduce((result, current) => {
|
|
249
|
+
result[current] = true;
|
|
250
|
+
return result;
|
|
251
|
+
}, globalThis.Object.create(null))
|
|
252
|
+
: typeof this.stringCondition == "string"
|
|
253
|
+
? { [this.stringCondition]: true }
|
|
254
|
+
: typeof this.stringCondition == "object" // Record or RegExp!
|
|
255
|
+
? this.stringCondition
|
|
256
|
+
: true);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function string(condition) {
|
|
260
|
+
return new IslyString(condition);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
var Flaw;
|
|
264
|
+
(function (Flaw) {
|
|
265
|
+
Flaw.type = object({
|
|
266
|
+
message: string().optional(),
|
|
267
|
+
isFlaw: boolean().optional(),
|
|
268
|
+
property: string().optional(),
|
|
269
|
+
type: string(),
|
|
270
|
+
flaws: array(lazy(() => Flaw.type)).optional(),
|
|
271
|
+
condition: string().optional(),
|
|
272
|
+
}, "Flaw");
|
|
273
|
+
Flaw.is = Flaw.type.is;
|
|
274
|
+
Flaw.flaw = Flaw.type.flaw;
|
|
275
|
+
})(Flaw || (Flaw = {}));
|
|
276
|
+
|
|
277
|
+
class IslyFromIs extends Type {
|
|
278
|
+
constructor(name, isFunction) {
|
|
279
|
+
super(name);
|
|
280
|
+
this.isFunction = isFunction;
|
|
281
|
+
this.is = (value => this.isFunction(value));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function fromIs(name, is) {
|
|
285
|
+
return new IslyFromIs(name, is);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const criteriaFunctions = {
|
|
289
|
+
positive: {
|
|
290
|
+
is: (value) => value > 0,
|
|
291
|
+
condition: "> 0",
|
|
292
|
+
},
|
|
293
|
+
negative: {
|
|
294
|
+
is: (value) => value < 0,
|
|
295
|
+
condition: "< 0",
|
|
296
|
+
},
|
|
297
|
+
integer: {
|
|
298
|
+
is: (value) => Number.isInteger(value),
|
|
299
|
+
condition: "Number.isInteger",
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
function fromCriteria(criteria) {
|
|
303
|
+
return /* Eg: criteria == 42 */ typeof criteria == "number"
|
|
304
|
+
? [value => value == criteria, " == " + criteria.toString()]
|
|
305
|
+
: // Eg: criteria == [0,1,2]
|
|
306
|
+
((c) => Array.isArray(c) && c.every(c => typeof c == "number"))(criteria)
|
|
307
|
+
? [value => criteria.map(fromCriteria).some(c => c[0](value)), criteria.join(" | ")]
|
|
308
|
+
: // Eg: criteria == ["positive", "negative"]
|
|
309
|
+
((c) => Array.isArray(c) && c.every(c => typeof c == "string" && c in criteriaFunctions))(criteria)
|
|
310
|
+
? [
|
|
311
|
+
value => criteria.map(fromCriteria).every(c => c[0](value)),
|
|
312
|
+
criteria
|
|
313
|
+
.map(fromCriteria)
|
|
314
|
+
.map(c => c[1])
|
|
315
|
+
.join(" & "),
|
|
316
|
+
]
|
|
317
|
+
: // Eg: criteria == () => true
|
|
318
|
+
typeof criteria === "function"
|
|
319
|
+
? [criteria, "custom"]
|
|
320
|
+
: // Eg: criteria == "positive"
|
|
321
|
+
criteria in criteriaFunctions
|
|
322
|
+
? [criteriaFunctions[criteria].is, criteriaFunctions[criteria].condition]
|
|
323
|
+
: // Eg: criteria is unknown
|
|
324
|
+
[() => false, "Unknown criteria"];
|
|
325
|
+
}
|
|
326
|
+
class IslyNumber extends Type {
|
|
327
|
+
constructor(isFunction, condition) {
|
|
328
|
+
super("number", condition);
|
|
329
|
+
this.isFunction = isFunction;
|
|
330
|
+
this.is = (value => typeof value == "number" &&
|
|
331
|
+
!Number.isNaN(value - value) && // NaN-NaN==NaN && Infinity-Infinity==NaN && (-Infinity)-(-Infinity)==NaN
|
|
332
|
+
(!this.isFunction || this.isFunction(value)));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* NaN, Infinite and -Infinite is not considered to be numbers by this type,
|
|
337
|
+
* since that it is hardly ever desirable when validating input data.
|
|
338
|
+
*
|
|
339
|
+
* @param criteria
|
|
340
|
+
* @returns
|
|
341
|
+
*/
|
|
342
|
+
function number(criteria) {
|
|
343
|
+
const [isFunction, condition] = criteria == undefined ? [undefined, undefined] : fromCriteria(criteria);
|
|
344
|
+
return new IslyNumber(isFunction, condition);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
class IslyRecord extends Type {
|
|
348
|
+
constructor(keyType, valueType) {
|
|
349
|
+
super(() => `Record<${keyType.name}, ${valueType.name}>`);
|
|
350
|
+
this.keyType = keyType;
|
|
351
|
+
this.valueType = valueType;
|
|
352
|
+
this.is = (value => !!(value &&
|
|
353
|
+
typeof value == "object" &&
|
|
354
|
+
!globalThis.Array.isArray(value) &&
|
|
355
|
+
globalThis.Object.entries(value).every(([key, value]) => this.keyType.is(this.keyType.name == "number" && `${+key}` == key ? +key : key) && this.valueType.is(value))));
|
|
356
|
+
}
|
|
357
|
+
createFlaw(value) {
|
|
358
|
+
return {
|
|
359
|
+
flaws: value &&
|
|
360
|
+
typeof value == "object" &&
|
|
361
|
+
!globalThis.Array.isArray(value) &&
|
|
362
|
+
globalThis.Object.entries(value).flatMap(([key, propertyValue]) => [
|
|
363
|
+
this.keyType.flaw(this.keyType.name == "number" && `${+key}` == key ? +key : key),
|
|
364
|
+
this.valueType.flaw(propertyValue),
|
|
365
|
+
]
|
|
366
|
+
.map((flaw, index) => (flaw.isFlaw ?? true) && { property: key + ` (${["key", "value"][index]})`, ...flaw })
|
|
367
|
+
.filter(Boolean)),
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
getValue(value) {
|
|
371
|
+
return globalThis.Object.fromEntries(globalThis.Object.entries(value).map(([key, value]) => [key, this.valueType.get(value)]));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function record(keyType, valueType) {
|
|
375
|
+
return new IslyRecord(keyType, valueType);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
class IslyUnion extends Type {
|
|
379
|
+
constructor(...types) {
|
|
380
|
+
super(() => types.map(type => type.name).join(" | "));
|
|
381
|
+
this.is = (value => this.types.some(type => type.is(value)));
|
|
382
|
+
this.types = types;
|
|
383
|
+
}
|
|
384
|
+
createFlaw(value) {
|
|
385
|
+
return {
|
|
386
|
+
flaws: this.types.map(type => type.flaw(value)).filter(flaw => flaw),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
getValue(value) {
|
|
390
|
+
return this.types.find(type => type.is(value))?.get(value);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
function union(...types) {
|
|
394
|
+
return new IslyUnion(...types);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
class IslyUndefined extends Type {
|
|
398
|
+
constructor() {
|
|
399
|
+
super(...arguments);
|
|
400
|
+
this.is = (value => value === undefined);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function islyUndefined(name) {
|
|
404
|
+
return new IslyUndefined(name ?? "undefined");
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
exports.Color = void 0;
|
|
408
|
+
(function (Color) {
|
|
409
|
+
Color.types = [
|
|
410
|
+
"default",
|
|
411
|
+
"primary",
|
|
412
|
+
"secondary",
|
|
413
|
+
"tertiary",
|
|
414
|
+
"success",
|
|
415
|
+
"warning",
|
|
416
|
+
"danger",
|
|
417
|
+
"light",
|
|
418
|
+
"medium",
|
|
419
|
+
"dark",
|
|
420
|
+
];
|
|
421
|
+
Color.type = string(Color.types);
|
|
422
|
+
Color.is = Color.type.is;
|
|
423
|
+
})(exports.Color || (exports.Color = {}));
|
|
424
|
+
|
|
425
|
+
exports.Icon = void 0;
|
|
426
|
+
(function (Icon) {
|
|
427
|
+
const names = {
|
|
428
|
+
"*": "https://ionicons.pages.dev/svg/${name}.svg",
|
|
429
|
+
};
|
|
430
|
+
const cache = {};
|
|
431
|
+
async function fetch(url) {
|
|
432
|
+
const response = await globalThis.fetch(url);
|
|
433
|
+
return response.ok ? response.text() : undefined;
|
|
434
|
+
}
|
|
435
|
+
async function load(name) {
|
|
436
|
+
var _a, _b;
|
|
437
|
+
const url = ((_a = names[name]) !== null && _a !== void 0 ? _a : names["*"]).replace("${name}", name);
|
|
438
|
+
return (_b = cache[url]) !== null && _b !== void 0 ? _b : (cache[url] = fetch(url));
|
|
439
|
+
}
|
|
440
|
+
Icon.load = load;
|
|
441
|
+
function add(url, ...name) {
|
|
442
|
+
for (const n of name)
|
|
443
|
+
names[n] = url;
|
|
444
|
+
}
|
|
445
|
+
Icon.add = add;
|
|
446
|
+
})(exports.Icon || (exports.Icon = {}));
|
|
447
|
+
|
|
448
|
+
class Message {
|
|
449
|
+
static is(value) {
|
|
450
|
+
return typeof value == "object" && typeof value.destination == "string" && value.content != undefined;
|
|
451
|
+
}
|
|
452
|
+
static send(message, content, context) {
|
|
453
|
+
if (Message.is(message) && context == undefined) {
|
|
454
|
+
context = content;
|
|
455
|
+
if (!context)
|
|
456
|
+
context = window;
|
|
457
|
+
const destination = message.destination.split("#", 2);
|
|
458
|
+
message = { destination: destination[1], content: message.content };
|
|
459
|
+
context.postMessage(message, destination[0]);
|
|
460
|
+
}
|
|
461
|
+
else if (typeof context != "string") {
|
|
462
|
+
if (!context)
|
|
463
|
+
context = window;
|
|
464
|
+
if (typeof message == "string")
|
|
465
|
+
Message.send({ destination: message, content }, context);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
static listen(origin, handle, context) {
|
|
469
|
+
const splitted = origin.split("#", 2);
|
|
470
|
+
let destination = "";
|
|
471
|
+
if (splitted.length == 2) {
|
|
472
|
+
origin = splitted[0];
|
|
473
|
+
destination = splitted[1];
|
|
474
|
+
}
|
|
475
|
+
(context || window).addEventListener("message", (e) => {
|
|
476
|
+
const message = e.data;
|
|
477
|
+
if (Message.is(message) &&
|
|
478
|
+
(origin == "*" || e.origin == origin) &&
|
|
479
|
+
(destination == "" || message.destination == destination))
|
|
480
|
+
handle(message.destination, message.content);
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
class Trigger {
|
|
486
|
+
static is(value) {
|
|
487
|
+
return typeof value == "object" && typeof value.name == "string";
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
492
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
493
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
494
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
495
|
+
};
|
|
496
|
+
var _Listenable_listeners;
|
|
497
|
+
class Listenable {
|
|
498
|
+
constructor() {
|
|
499
|
+
_Listenable_listeners.set(this, {});
|
|
500
|
+
}
|
|
501
|
+
listen(property, listener, options) {
|
|
502
|
+
var _a, _b;
|
|
503
|
+
(_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
|
|
504
|
+
if (!(options === null || options === void 0 ? void 0 : options.lazy))
|
|
505
|
+
listener(this[property]);
|
|
506
|
+
}
|
|
507
|
+
unlisten(property, listener) {
|
|
508
|
+
var _a, _b;
|
|
509
|
+
const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
|
|
510
|
+
index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
|
|
511
|
+
}
|
|
512
|
+
batchListen(listeners, options) {
|
|
513
|
+
for (const key in listeners) {
|
|
514
|
+
const listener = listeners[key];
|
|
515
|
+
listener && this.listen(key, listener, options);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
batchUnlisten(listeners) {
|
|
519
|
+
for (const key in listeners) {
|
|
520
|
+
const listener = listeners[key];
|
|
521
|
+
listener && this.unlisten(key, listener);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
static load(backend) {
|
|
525
|
+
const result = backend.listenable;
|
|
526
|
+
return Object.defineProperties(result, getProperties(backend));
|
|
527
|
+
function getProperties(backend) {
|
|
528
|
+
return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
|
|
529
|
+
name,
|
|
530
|
+
typeof descriptor.value == "function"
|
|
531
|
+
? {
|
|
532
|
+
get() {
|
|
533
|
+
return backend[name].bind(backend);
|
|
534
|
+
},
|
|
535
|
+
}
|
|
536
|
+
: descriptor.writable || descriptor.set
|
|
537
|
+
? {
|
|
538
|
+
get() {
|
|
539
|
+
return backend[name];
|
|
540
|
+
},
|
|
541
|
+
set(value) {
|
|
542
|
+
var _a;
|
|
543
|
+
backend[name] = value;
|
|
544
|
+
(_a = __classPrivateFieldGet(result, _Listenable_listeners, "f")[name]) === null || _a === void 0 ? void 0 : _a.forEach(listener => listener(backend[name]));
|
|
545
|
+
},
|
|
546
|
+
}
|
|
547
|
+
: {
|
|
548
|
+
get() {
|
|
549
|
+
return backend[name];
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
]));
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
_Listenable_listeners = new WeakMap();
|
|
557
|
+
|
|
558
|
+
exports.Data = void 0;
|
|
559
|
+
(function (Data) {
|
|
560
|
+
Data.valueType = union(string(), number(), boolean(), fromIs("Blob", value => value instanceof Blob), islyUndefined());
|
|
561
|
+
Data.type = record(string(), union(lazy(() => Data.type, "Data"), Data.valueType));
|
|
562
|
+
function set(data, [head, ...tail], value) {
|
|
563
|
+
const current = data[head !== null && head !== void 0 ? head : ""];
|
|
564
|
+
return Object.assign(Object.assign({}, data), { [head !== null && head !== void 0 ? head : ""]: !tail.length
|
|
565
|
+
? value
|
|
566
|
+
: set(typeof current == "object" && !(current instanceof Blob) ? current : {}, tail, value) });
|
|
567
|
+
}
|
|
568
|
+
Data.set = set;
|
|
569
|
+
function deepen(data) {
|
|
570
|
+
return merge({}, data);
|
|
571
|
+
}
|
|
572
|
+
Data.deepen = deepen;
|
|
573
|
+
function merge(data, changes) {
|
|
574
|
+
return Object.entries(changes).reduce((r, [name, value]) => set(r, name.split("."), value), data);
|
|
575
|
+
}
|
|
576
|
+
Data.merge = merge;
|
|
577
|
+
})(exports.Data || (exports.Data = {}));
|
|
578
|
+
|
|
579
|
+
exports.Listenable = Listenable;
|
|
580
|
+
exports.Message = Message;
|
|
581
|
+
exports.Trigger = Trigger;
|
|
582
|
+
exports.Type = Type;
|
|
583
|
+
exports.boolean = boolean;
|
|
584
|
+
exports.object = object;
|
|
585
|
+
exports.record = record;
|
|
586
|
+
exports.string = string;
|
|
587
|
+
exports.union = union;
|
|
588
|
+
|
|
589
|
+
//# sourceMappingURL=Data-50d47740.js.map
|