@livenetworks/ashlar 1.6.1 → 2.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/LICENSE +641 -0
- package/README.md +202 -86
- package/{js → components}/COMPONENTS.md +1116 -1108
- package/{js → components}/index.js +81 -58
- package/{js → components}/ln-accordion/README.md +7 -6
- package/components/ln-accordion/ln-accordion-dev.scss +8 -0
- package/components/ln-accordion/ln-accordion.js +1 -0
- package/components/ln-accordion/ln-accordion.schema.json +30 -0
- package/components/ln-accordion/ln-accordion.scss +8 -0
- package/{js → components}/ln-accordion/src/ln-accordion.js +8 -2
- package/{js → components}/ln-ajax/README.md +171 -160
- package/components/ln-ajax/ln-ajax-dev.scss +8 -0
- package/components/ln-ajax/ln-ajax.js +1 -0
- package/components/ln-ajax/ln-ajax.schema.json +30 -0
- package/{js → components}/ln-ajax/src/ln-ajax.js +65 -30
- package/{js → components}/ln-api-connector/README.md +27 -5
- package/components/ln-api-connector/ln-api-connector.js +1 -0
- package/components/ln-api-connector/ln-api-connector.schema.json +96 -0
- package/components/ln-api-connector/src/connector-core.js +97 -0
- package/components/ln-api-connector/src/ln-api-connector.js +447 -0
- package/{js → components}/ln-api-queue/README.md +12 -9
- package/components/ln-api-queue/ln-api-queue.js +1 -0
- package/components/ln-api-queue/ln-api-queue.schema.json +34 -0
- package/{js → components}/ln-api-queue/src/ln-api-queue.js +33 -14
- package/{js → components}/ln-api-queue/src/queue-storage.js +7 -3
- package/{js → components}/ln-autoresize/README.md +129 -127
- package/components/ln-autoresize/ln-autoresize-dev.scss +8 -0
- package/components/ln-autoresize/ln-autoresize.js +1 -0
- package/components/ln-autoresize/ln-autoresize.schema.json +22 -0
- package/{js → components}/ln-autoresize/src/ln-autoresize.js +8 -1
- package/{js → components}/ln-autosave/README.md +127 -124
- package/components/ln-autosave/ln-autosave-dev.scss +13 -0
- package/components/ln-autosave/ln-autosave.js +1 -0
- package/components/ln-autosave/ln-autosave.schema.json +48 -0
- package/components/ln-autosave/src/autosave-model.js +34 -0
- package/{js → components}/ln-autosave/src/ln-autosave.js +65 -58
- package/components/ln-chart/README.md +145 -0
- package/components/ln-chart/ln-chart-dev.scss +20 -0
- package/components/ln-chart/ln-chart.js +1 -0
- package/components/ln-chart/ln-chart.schema.json +146 -0
- package/components/ln-chart/ln-chart.scss +8 -0
- package/components/ln-chart/src/chart-model.js +154 -0
- package/components/ln-chart/src/ln-chart.js +176 -0
- package/{js → components}/ln-circular-progress/README.md +15 -14
- package/components/ln-circular-progress/ln-circular-progress-dev.scss +8 -0
- package/components/ln-circular-progress/ln-circular-progress.js +1 -0
- package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -0
- package/{js → components}/ln-circular-progress/src/ln-circular-progress.js +32 -50
- package/{js → components}/ln-confirm/README.md +69 -18
- package/components/ln-confirm/ln-confirm-dev.scss +24 -0
- package/components/ln-confirm/ln-confirm.js +1 -0
- package/components/ln-confirm/ln-confirm.schema.json +66 -0
- package/components/ln-confirm/ln-confirm.scss +24 -0
- package/{js → components}/ln-confirm/src/ln-confirm.js +180 -171
- package/{js → components}/ln-core/README.md +374 -149
- package/components/ln-core/attrs.js +273 -0
- package/components/ln-core/compare.js +40 -0
- package/components/ln-core/crypto.js +265 -0
- package/components/ln-core/date.js +50 -0
- package/components/ln-core/dom.js +115 -0
- package/components/ln-core/events.js +122 -0
- package/components/ln-core/form.js +136 -0
- package/{js → components}/ln-core/hash.js +149 -92
- package/components/ln-core/helpers.js +33 -0
- package/components/ln-core/http.js +48 -0
- package/components/ln-core/index.js +11 -0
- package/components/ln-core/lifecycle.js +403 -0
- package/components/ln-core/ln-core.schema.json +109 -0
- package/components/ln-core/locale.js +55 -0
- package/components/ln-core/matching.js +78 -0
- package/components/ln-core/number.js +125 -0
- package/components/ln-core/progress.js +30 -0
- package/components/ln-core/template.js +206 -0
- package/{js → components}/ln-core/window-cache.js +247 -213
- package/{js → components}/ln-couchdb-connector/README.md +7 -5
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -0
- package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -0
- package/{js → components}/ln-couchdb-connector/src/ln-couchdb-connector.js +29 -43
- package/{js → components}/ln-data-coordinator/README.md +109 -73
- package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -0
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -0
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +196 -0
- package/components/ln-data-coordinator/src/data-read-policy.js +41 -0
- package/{js → components}/ln-data-coordinator/src/ln-data-coordinator.js +411 -154
- package/{js → components}/ln-data-coordinator/src/mutation-receipts.js +0 -5
- package/{js → components}/ln-data-store/README.md +42 -17
- package/components/ln-data-store/ln-data-store-dev.scss +13 -0
- package/components/ln-data-store/ln-data-store.js +1 -0
- package/components/ln-data-store/ln-data-store.schema.json +84 -0
- package/components/ln-data-store/src/data-store-model.js +155 -0
- package/{js → components}/ln-data-store/src/ln-data-store.js +407 -105
- package/components/ln-data-store/src/window-index.js +119 -0
- package/{js → components}/ln-date/README.md +17 -7
- package/{js → components}/ln-date/ln-date-dev.scss +14 -14
- package/components/ln-date/ln-date.js +1 -0
- package/components/ln-date/ln-date.schema.json +92 -0
- package/components/ln-date/src/date-model.js +186 -0
- package/components/ln-date/src/ln-date.js +486 -0
- package/components/ln-debug/README.md +132 -0
- package/components/ln-debug/ln-debug.js +1 -0
- package/components/ln-debug/ln-debug.schema.json +28 -0
- package/components/ln-debug/src/console-sink.js +19 -0
- package/components/ln-debug/src/debug-verifier.js +331 -0
- package/components/ln-debug/src/gate.js +95 -0
- package/components/ln-debug/src/generated-attributes.js +299 -0
- package/components/ln-debug/src/ln-debug.js +60 -0
- package/{js → components}/ln-dropdown/README.md +150 -140
- package/components/ln-dropdown/ln-dropdown-dev.scss +13 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -0
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -0
- package/components/ln-dropdown/ln-dropdown.scss +18 -0
- package/{js → components}/ln-dropdown/src/ln-dropdown.js +114 -11
- package/{js → components}/ln-editor/README.md +11 -9
- package/components/ln-editor/ln-editor-dev.scss +18 -0
- package/components/ln-editor/ln-editor.js +1 -0
- package/components/ln-editor/ln-editor.schema.json +58 -0
- package/components/ln-editor/ln-editor.scss +13 -0
- package/{js → components}/ln-editor/src/ln-editor.js +59 -11
- package/{js → components}/ln-external-links/README.md +10 -8
- package/components/ln-external-links/ln-external-links.js +1 -0
- package/components/ln-external-links/ln-external-links.schema.json +18 -0
- package/{js → components}/ln-external-links/src/ln-external-links.js +13 -11
- package/{js → components}/ln-fill/README.md +6 -8
- package/components/ln-fill/ln-fill.js +1 -0
- package/components/ln-fill/ln-fill.schema.json +23 -0
- package/{js → components}/ln-fill/src/ln-fill.js +7 -1
- package/components/ln-filter/README.md +131 -0
- package/components/ln-filter/ln-filter-dev.scss +13 -0
- package/components/ln-filter/ln-filter.js +1 -0
- package/components/ln-filter/ln-filter.schema.json +153 -0
- package/components/ln-filter/src/filter-model.js +185 -0
- package/components/ln-filter/src/ln-filter.js +435 -0
- package/{js → components}/ln-form/README.md +260 -264
- package/components/ln-form/ln-form-dev.scss +8 -0
- package/components/ln-form/ln-form.js +1 -0
- package/components/ln-form/ln-form.schema.json +45 -0
- package/{js → components}/ln-form/src/ln-form.js +107 -99
- package/{js → components}/ln-http/README.md +11 -6
- package/components/ln-http/ln-http.js +1 -0
- package/components/ln-http/ln-http.schema.json +6 -0
- package/components/ln-http/src/http-core.js +51 -0
- package/{js → components}/ln-http/src/ln-http.js +28 -33
- package/{js → components}/ln-icon/README.md +16 -9
- package/components/ln-icon/ln-icon.schema.json +6 -0
- package/components/ln-include/README.md +75 -0
- package/components/ln-include/ln-include-dev.scss +13 -0
- package/components/ln-include/ln-include.js +1 -0
- package/components/ln-include/ln-include.schema.json +23 -0
- package/components/ln-include/src/ln-include.js +111 -0
- package/components/ln-key/README.md +130 -0
- package/components/ln-key/ln-key-dev.scss +18 -0
- package/components/ln-key/ln-key.js +1 -0
- package/components/ln-key/ln-key.schema.json +56 -0
- package/components/ln-key/src/key-model.js +146 -0
- package/components/ln-key/src/ln-key.js +201 -0
- package/{js → components}/ln-link/README.md +7 -9
- package/components/ln-link/ln-link-dev.scss +8 -0
- package/components/ln-link/ln-link.js +1 -0
- package/components/ln-link/ln-link.schema.json +22 -0
- package/{js → components}/ln-link/src/ln-link.js +16 -11
- package/components/ln-list/README.md +152 -0
- package/components/ln-list/ln-list-dev.scss +8 -0
- package/components/ln-list/ln-list.js +1 -0
- package/components/ln-list/ln-list.schema.json +166 -0
- package/components/ln-list/ln-list.scss +25 -0
- package/{js → components}/ln-list/src/ln-list.js +1301 -1216
- package/{js → components}/ln-modal/README.md +13 -10
- package/components/ln-modal/ln-modal-dev.scss +18 -0
- package/components/ln-modal/ln-modal.js +1 -0
- package/components/ln-modal/ln-modal.schema.json +54 -0
- package/components/ln-modal/ln-modal.scss +51 -0
- package/{js → components}/ln-modal/src/ln-modal.js +164 -137
- package/{js → components}/ln-nav/README.md +11 -11
- package/components/ln-nav/ln-nav.js +1 -0
- package/components/ln-nav/ln-nav.schema.json +25 -0
- package/{js → components}/ln-nav/src/ln-nav.js +25 -14
- package/components/ln-number/README.md +205 -0
- package/{js → components}/ln-number/ln-number-dev.scss +13 -13
- package/components/ln-number/ln-number.js +1 -0
- package/components/ln-number/ln-number.schema.json +63 -0
- package/components/ln-number/src/ln-number.js +400 -0
- package/components/ln-number/src/number-model.js +31 -0
- package/components/ln-obfuscator/README.md +60 -0
- package/components/ln-obfuscator/ln-obfuscator.js +1 -0
- package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -0
- package/components/ln-obfuscator/src/ln-obfuscator.js +159 -0
- package/components/ln-obfuscator/src/obfuscator-model.js +250 -0
- package/{js → components}/ln-options/README.md +3 -1
- package/components/ln-options/ln-options-dev.scss +13 -0
- package/components/ln-options/ln-options.js +1 -0
- package/components/ln-options/ln-options.schema.json +41 -0
- package/{js → components}/ln-options/src/ln-options.js +13 -5
- package/components/ln-persist/README.md +151 -0
- package/components/ln-persist/ln-persist.js +1 -0
- package/components/ln-persist/ln-persist.schema.json +28 -0
- package/components/ln-persist/src/ln-persist.js +83 -0
- package/components/ln-picklist/README.md +230 -0
- package/components/ln-picklist/ln-picklist-dev.scss +22 -0
- package/components/ln-picklist/ln-picklist.js +1 -0
- package/components/ln-picklist/ln-picklist.schema.json +49 -0
- package/components/ln-picklist/src/ln-picklist.js +228 -0
- package/{js → components}/ln-popover/README.md +164 -162
- package/components/ln-popover/ln-popover-dev.scss +13 -0
- package/components/ln-popover/ln-popover.js +1 -0
- package/components/ln-popover/ln-popover.schema.json +82 -0
- package/components/ln-popover/ln-popover.scss +18 -0
- package/{js → components}/ln-popover/src/ln-popover.js +42 -36
- package/{js → components}/ln-progress/README.md +410 -413
- package/components/ln-progress/ln-progress-dev.scss +8 -0
- package/components/ln-progress/ln-progress.js +1 -0
- package/components/ln-progress/ln-progress.schema.json +40 -0
- package/components/ln-progress/src/ln-progress.js +91 -0
- package/components/ln-progress/src/progress-model.js +20 -0
- package/{js → components}/ln-router/README.md +443 -432
- package/components/ln-router/ln-router-dev.scss +13 -0
- package/components/ln-router/ln-router.js +1 -0
- package/components/ln-router/ln-router.schema.json +68 -0
- package/{js → components}/ln-router/src/ln-router.js +585 -539
- package/components/ln-router/src/router-model.js +50 -0
- package/components/ln-scroll/README.md +45 -0
- package/components/ln-scroll/ln-scroll.js +1 -0
- package/components/ln-scroll/ln-scroll.schema.json +85 -0
- package/components/ln-scroll/src/ln-scroll.js +150 -0
- package/components/ln-search/README.md +188 -0
- package/components/ln-search/ln-search-dev.scss +13 -0
- package/components/ln-search/ln-search.js +1 -0
- package/components/ln-search/ln-search.schema.json +103 -0
- package/components/ln-search/src/ln-search.js +330 -0
- package/{js → components}/ln-slug/README.md +6 -3
- package/components/ln-slug/ln-slug-dev.scss +18 -0
- package/components/ln-slug/ln-slug.js +1 -0
- package/components/ln-slug/ln-slug.schema.json +23 -0
- package/{js → components}/ln-slug/src/ln-slug.js +20 -13
- package/components/ln-slug/src/slug-model.js +21 -0
- package/{js → components}/ln-sort/README.md +178 -170
- package/{js → components}/ln-sort/ln-sort-dev.scss +8 -8
- package/components/ln-sort/ln-sort.js +1 -0
- package/components/ln-sort/ln-sort.schema.json +104 -0
- package/components/ln-sort/src/ln-sort.js +321 -0
- package/components/ln-sort/src/sort-model.js +117 -0
- package/{js → components}/ln-sortable/README.md +7 -11
- package/components/ln-sortable/ln-sortable-dev.scss +13 -0
- package/components/ln-sortable/ln-sortable.js +1 -0
- package/components/ln-sortable/ln-sortable.schema.json +36 -0
- package/{js → components}/ln-sortable/src/ln-sortable.js +8 -13
- package/{js → components}/ln-stat/README.md +3 -1
- package/components/ln-stat/ln-stat-dev.scss +8 -0
- package/components/ln-stat/ln-stat.js +1 -0
- package/components/ln-stat/ln-stat.schema.json +32 -0
- package/{js → components}/ln-stat/src/ln-stat.js +14 -18
- package/components/ln-stat/src/stat-model.js +28 -0
- package/{js → components}/ln-table/README.md +37 -24
- package/{js → components}/ln-table/ln-table-dev.scss +17 -17
- package/components/ln-table/ln-table.js +1 -0
- package/components/ln-table/ln-table.schema.json +211 -0
- package/components/ln-table/ln-table.scss +15 -0
- package/{js → components}/ln-table/src/ln-table.js +1365 -1493
- package/components/ln-table/src/table-model.js +98 -0
- package/components/ln-table-coordinator/README.md +61 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -0
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -0
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +193 -0
- package/{js → components}/ln-tabs/README.md +32 -14
- package/components/ln-tabs/ln-tabs-dev.scss +24 -0
- package/components/ln-tabs/ln-tabs.js +1 -0
- package/components/ln-tabs/ln-tabs.schema.json +75 -0
- package/components/ln-tabs/ln-tabs.scss +8 -0
- package/components/ln-tabs/src/ln-tabs.js +207 -0
- package/components/ln-tabs/src/tabs-model.js +82 -0
- package/{js → components}/ln-time/README.md +96 -95
- package/components/ln-time/ln-time-dev.scss +13 -0
- package/components/ln-time/ln-time.js +1 -0
- package/components/ln-time/ln-time.schema.json +38 -0
- package/{js → components}/ln-time/src/ln-time.js +206 -223
- package/components/ln-time/src/time-model.js +64 -0
- package/{js → components}/ln-toast/README.md +23 -5
- package/components/ln-toast/ln-toast-dev.scss +8 -0
- package/components/ln-toast/ln-toast.js +1 -0
- package/components/ln-toast/ln-toast.schema.json +65 -0
- package/components/ln-toast/ln-toast.scss +59 -0
- package/{js → components}/ln-toast/src/ln-toast.js +233 -232
- package/{js → components}/ln-toggle/README.md +198 -196
- package/{js → components}/ln-toggle/ln-toggle-dev.scss +13 -13
- package/components/ln-toggle/ln-toggle.js +1 -0
- package/components/ln-toggle/ln-toggle.schema.json +52 -0
- package/components/ln-toggle/ln-toggle.scss +37 -0
- package/{js → components}/ln-toggle/src/ln-toggle.js +61 -46
- package/{js → components}/ln-tooltip/README.md +6 -6
- package/{js → components}/ln-tooltip/ln-tooltip-dev.scss +9 -9
- package/components/ln-tooltip/ln-tooltip.js +1 -0
- package/components/ln-tooltip/ln-tooltip.schema.json +86 -0
- package/components/ln-tooltip/ln-tooltip.scss +9 -0
- package/{js → components}/ln-tooltip/src/ln-tooltip.js +14 -3
- package/{js → components}/ln-translations/README.md +3 -1
- package/components/ln-translations/ln-translations-dev.scss +13 -0
- package/components/ln-translations/ln-translations.js +1 -0
- package/components/ln-translations/ln-translations.schema.json +120 -0
- package/{js → components}/ln-translations/src/ln-translations.js +25 -10
- package/components/ln-ui-coordinator/README.md +101 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator-dev.scss +8 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +60 -0
- package/{js/ln-modal-coordinator/src/ln-modal-coordinator.js → components/ln-ui-coordinator/src/ln-ui-coordinator.js} +403 -345
- package/components/ln-upload/README.md +133 -0
- package/components/ln-upload/ln-upload-dev.scss +18 -0
- package/components/ln-upload/ln-upload.js +1 -0
- package/components/ln-upload/ln-upload.schema.json +193 -0
- package/components/ln-upload/ln-upload.scss +20 -0
- package/components/ln-upload/src/ln-upload.js +652 -0
- package/components/ln-upload/src/upload-model.js +78 -0
- package/{js → components}/ln-validate/README.md +182 -180
- package/{js → components}/ln-validate/ln-validate-dev.scss +15 -15
- package/components/ln-validate/ln-validate.js +1 -0
- package/components/ln-validate/ln-validate.schema.json +50 -0
- package/components/ln-validate/ln-validate.scss +7 -0
- package/{js → components}/ln-validate/src/ln-validate.js +23 -45
- package/components/ln-validate/src/validate-model.js +64 -0
- package/components/ln-websocket-connector/README.md +166 -0
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -0
- package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -0
- package/components/ln-websocket-connector/src/ln-websocket-connector.js +279 -0
- package/ln-ashlar.html-data.json +1796 -0
- package/package.json +84 -61
- package/{scss → theme}/base/_global.scss +1 -2
- package/{scss → theme}/base/_reset.scss +1 -1
- package/{scss → theme}/base/_typography.scss +2 -0
- package/theme/brand.css +73 -0
- package/{scss → theme}/components/_app-shell.scss +8 -0
- package/theme/components/_button.scss +24 -0
- package/theme/components/_chart.scss +5 -0
- package/theme/components/_confirm.scss +6 -0
- package/{scss → theme}/components/_date.scss +30 -22
- package/{scss → theme}/components/_dropdown.scss +6 -1
- package/theme/components/_form.scss +140 -0
- package/{scss → theme}/components/_layout.scss +6 -0
- package/{scss → theme}/components/_ln-table.scss +1 -6
- package/theme/components/_picklist.scss +3 -0
- package/{scss → theme}/components/_sort.scss +10 -10
- package/theme/components/_status-badge.scss +6 -0
- package/{scss → theme}/components/_table.scss +16 -0
- package/{scss → theme}/components/_tabs.scss +0 -4
- package/theme/components/_toast.scss +48 -0
- package/{scss → theme}/components/_toggle.scss +1 -1
- package/theme/components/_upload.scss +45 -0
- package/{scss → theme}/config/_breakpoints.scss +1 -1
- package/theme/config/_contrast.scss +128 -0
- package/{scss → theme}/config/_density.scss +191 -205
- package/theme/config/_palette.scss +274 -0
- package/theme/config/_theme.scss +293 -0
- package/{scss → theme}/config/_tokens.scss +285 -441
- package/{scss → theme}/config/mixins/_accordion.scss +1 -1
- package/{scss → theme}/config/mixins/_alert.scss +1 -0
- package/{scss → theme}/config/mixins/_app-shell.scss +4 -2
- package/{scss → theme}/config/mixins/_borders.scss +2 -0
- package/theme/config/mixins/_btn.scss +175 -0
- package/{scss → theme}/config/mixins/_card.scss +55 -46
- package/theme/config/mixins/_chart.scss +82 -0
- package/{scss → theme}/config/mixins/_collapsible.scss +2 -1
- package/{scss → theme}/config/mixins/_colors.scss +8 -14
- package/{scss → theme}/config/mixins/_diagnostics.scss +48 -48
- package/theme/config/mixins/_dropdown.scss +169 -0
- package/{scss → theme}/config/mixins/_editor.scss +0 -7
- package/{scss → theme}/config/mixins/_filter.scss +47 -47
- package/{scss → theme}/config/mixins/_footer.scss +1 -1
- package/{scss → theme}/config/mixins/_form.scss +49 -18
- package/{scss → theme}/config/mixins/_index.scss +62 -61
- package/{scss → theme}/config/mixins/_layout.scss +6 -2
- package/{scss → theme}/config/mixins/_ln-table.scss +31 -10
- package/{scss → theme}/config/mixins/_loader.scss +1 -1
- package/{scss → theme}/config/mixins/_modal.scss +145 -149
- package/{scss → theme}/config/mixins/_motion.scss +13 -0
- package/{scss → theme}/config/mixins/_nav.scss +7 -7
- package/theme/config/mixins/_picklist.scss +66 -0
- package/theme/config/mixins/_popover.scss +96 -0
- package/{scss → theme}/config/mixins/_sidebar.scss +7 -4
- package/{scss → theme}/config/mixins/_sort.scss +43 -42
- package/{scss → theme}/config/mixins/_status-badge.scss +15 -2
- package/{scss → theme}/config/mixins/_table.scss +25 -14
- package/{scss → theme}/config/mixins/_tabs.scss +1 -1
- package/{scss → theme}/config/mixins/_toast.scss +174 -179
- package/{scss → theme}/config/mixins/_tooltip.scss +2 -2
- package/{scss → theme}/config/mixins/_typography.scss +16 -5
- package/{scss → theme}/config/mixins/_upload.scss +8 -6
- package/theme/ln-ashlar-core.scss +24 -0
- package/theme/ln-ashlar-dev.scss +66 -0
- package/theme/ln-ashlar-landing.scss +56 -0
- package/{scss/ln-ashlar.scss → theme/ln-ashlar-theme.scss} +63 -69
- package/theme/ln-ashlar.scss +8 -0
- package/theme/presentation/_bento.scss +151 -0
- package/theme/presentation/_cta.scss +111 -0
- package/theme/presentation/_effects.scss +216 -0
- package/theme/presentation/_features.scss +108 -0
- package/theme/presentation/_footer.scss +129 -0
- package/theme/presentation/_hero.scss +158 -0
- package/theme/presentation/_layout.scss +170 -0
- package/theme/presentation/_navbar.scss +140 -0
- package/theme/presentation/_pricing.scss +262 -0
- package/theme/presentation/_stats.scss +87 -0
- package/theme/presentation/_testimonials.scss +124 -0
- package/theme/presentation/_tokens.scss +39 -0
- package/theme/presentation/_typography.scss +163 -0
- package/{scss → theme}/utilities/_animations.scss +38 -0
- package/{scss → theme}/utilities/_utilities.scss +6 -0
- package/web-types.json +2312 -0
- package/js/ln-accordion/ln-accordion.js +0 -1
- package/js/ln-ajax/ln-ajax.js +0 -1
- package/js/ln-api-connector/ln-api-connector.js +0 -1
- package/js/ln-api-connector/src/ln-api-connector.js +0 -368
- package/js/ln-api-queue/ln-api-queue.js +0 -1
- package/js/ln-autoresize/ln-autoresize.js +0 -1
- package/js/ln-autosave/ln-autosave.js +0 -1
- package/js/ln-circular-progress/ln-circular-progress.js +0 -1
- package/js/ln-confirm/_ln-confirm.scss +0 -24
- package/js/ln-confirm/ln-confirm.js +0 -1
- package/js/ln-core/crypto.js +0 -83
- package/js/ln-core/helpers.js +0 -788
- package/js/ln-core/index.js +0 -7
- package/js/ln-core/persist.js +0 -97
- package/js/ln-couchdb-connector/ln-couchdb-connector.js +0 -1
- package/js/ln-data-coordinator/ln-data-coordinator.js +0 -1
- package/js/ln-data-coordinator/src/data-read-policy.js +0 -18
- package/js/ln-data-store/ln-data-store.js +0 -1
- package/js/ln-date/ln-date.js +0 -1
- package/js/ln-date/src/ln-date.js +0 -603
- package/js/ln-debug/README.md +0 -58
- package/js/ln-debug/ln-debug.js +0 -1
- package/js/ln-debug/src/ln-debug.js +0 -19
- package/js/ln-dropdown/ln-dropdown.js +0 -1
- package/js/ln-dropdown/ln-dropdown.scss +0 -15
- package/js/ln-editor/ln-editor.js +0 -1
- package/js/ln-editor/ln-editor.scss +0 -43
- package/js/ln-external-links/ln-external-links.js +0 -1
- package/js/ln-fill/ln-fill.js +0 -1
- package/js/ln-filter/README.md +0 -189
- package/js/ln-filter/ln-filter-dev.scss +0 -8
- package/js/ln-filter/ln-filter.js +0 -1
- package/js/ln-filter/src/ln-filter.js +0 -419
- package/js/ln-form/ln-form.js +0 -1
- package/js/ln-http/ln-http.js +0 -1
- package/js/ln-link/ln-link.js +0 -1
- package/js/ln-list/README.md +0 -129
- package/js/ln-list/ln-list.js +0 -1
- package/js/ln-list/ln-list.scss +0 -28
- package/js/ln-modal/ln-modal-dev.scss +0 -13
- package/js/ln-modal/ln-modal.js +0 -1
- package/js/ln-modal/ln-modal.scss +0 -35
- package/js/ln-modal-coordinator/README.md +0 -99
- package/js/ln-modal-coordinator/ln-modal-coordinator-dev.scss +0 -8
- package/js/ln-modal-coordinator/ln-modal-coordinator.js +0 -1
- package/js/ln-nav/ln-nav.js +0 -1
- package/js/ln-number/README.md +0 -149
- package/js/ln-number/ln-number.js +0 -1
- package/js/ln-number/src/ln-number.js +0 -443
- package/js/ln-options/ln-options.js +0 -1
- package/js/ln-popover/ln-popover.js +0 -1
- package/js/ln-progress/ln-progress.js +0 -1
- package/js/ln-progress/src/ln-progress.js +0 -98
- package/js/ln-router/ln-router.js +0 -1
- package/js/ln-search/README.md +0 -158
- package/js/ln-search/ln-search-dev.scss +0 -8
- package/js/ln-search/ln-search.js +0 -1
- package/js/ln-search/src/ln-search.js +0 -117
- package/js/ln-slug/ln-slug.js +0 -1
- package/js/ln-sort/ln-sort.js +0 -1
- package/js/ln-sort/src/ln-sort.js +0 -178
- package/js/ln-sortable/ln-sortable.js +0 -1
- package/js/ln-stat/ln-stat.js +0 -1
- package/js/ln-table/ln-table.js +0 -1
- package/js/ln-table/ln-table.scss +0 -11
- package/js/ln-table-coordinator/README.md +0 -73
- package/js/ln-table-coordinator/ln-table-coordinator.js +0 -1
- package/js/ln-table-coordinator/src/ln-table-coordinator.js +0 -160
- package/js/ln-tabs/ln-tabs-dev.scss +0 -18
- package/js/ln-tabs/ln-tabs.js +0 -1
- package/js/ln-tabs/src/ln-tabs.js +0 -188
- package/js/ln-time/ln-time.js +0 -1
- package/js/ln-toast/ln-toast.js +0 -1
- package/js/ln-toggle/ln-toggle.js +0 -1
- package/js/ln-tooltip/ln-tooltip.js +0 -1
- package/js/ln-tooltip/ln-tooltip.scss +0 -9
- package/js/ln-translations/ln-translations.js +0 -1
- package/js/ln-upload/README.md +0 -255
- package/js/ln-upload/ln-upload.js +0 -1
- package/js/ln-upload/ln-upload.scss +0 -20
- package/js/ln-upload/src/ln-upload.js +0 -423
- package/js/ln-validate/ln-validate.js +0 -1
- package/scss/components/_button.scss +0 -20
- package/scss/components/_confirm.scss +0 -5
- package/scss/components/_form.scss +0 -107
- package/scss/components/_status-badge.scss +0 -4
- package/scss/components/_toast.scss +0 -68
- package/scss/components/_upload.scss +0 -51
- package/scss/config/_theme.scss +0 -216
- package/scss/config/mixins/_btn.scss +0 -179
- package/scss/config/mixins/_confirm.scss +0 -31
- package/scss/config/mixins/_dropdown.scss +0 -141
- package/scss/config/mixins/_popover.scss +0 -64
- package/scss/ln-ashlar-dev.scss +0 -39
- /package/{js → components}/ln-core/positioning.js +0 -0
- /package/{js → components}/ln-core/reactive.js +0 -0
- /package/{js → components}/ln-filter/ln-filter.scss +0 -0
- /package/{js → components}/ln-icon/ln-icon.js +0 -0
- /package/{js → components}/ln-icon/src/ln-icon.js +0 -0
- /package/{js → components}/ln-search/ln-search.scss +0 -0
- /package/{js → components}/ln-toast/template.html +0 -0
- /package/{scss → theme}/components/_accordion.scss +0 -0
- /package/{scss → theme}/components/_ajax.scss +0 -0
- /package/{scss → theme}/components/_alert.scss +0 -0
- /package/{scss → theme}/components/_avatar.scss +0 -0
- /package/{scss → theme}/components/_breadcrumbs.scss +0 -0
- /package/{scss → theme}/components/_card.scss +0 -0
- /package/{scss → theme}/components/_chip.scss +0 -0
- /package/{scss → theme}/components/_circular-progress.scss +0 -0
- /package/{scss → theme}/components/_editor.scss +0 -0
- /package/{scss → theme}/components/_empty-state.scss +0 -0
- /package/{scss → theme}/components/_filter.scss +0 -0
- /package/{scss → theme}/components/_link.scss +0 -0
- /package/{scss → theme}/components/_loader.scss +0 -0
- /package/{scss → theme}/components/_modal.scss +0 -0
- /package/{scss → theme}/components/_nav.scss +0 -0
- /package/{scss → theme}/components/_page-header.scss +0 -0
- /package/{scss → theme}/components/_popover.scss +0 -0
- /package/{scss → theme}/components/_progress.scss +0 -0
- /package/{scss → theme}/components/_prose.scss +0 -0
- /package/{scss → theme}/components/_scrollbar.scss +0 -0
- /package/{scss → theme}/components/_sections.scss +0 -0
- /package/{scss → theme}/components/_sidebar.scss +0 -0
- /package/{scss → theme}/components/_stat-card.scss +0 -0
- /package/{scss → theme}/components/_stepper.scss +0 -0
- /package/{scss → theme}/components/_timeline.scss +0 -0
- /package/{scss → theme}/components/_tooltip.scss +0 -0
- /package/{scss → theme}/components/_translations.scss +0 -0
- /package/{scss → theme}/config/_icons.scss +0 -0
- /package/{scss → theme}/config/_mixins.scss +0 -0
- /package/{scss → theme}/config/mixins/_ajax.scss +0 -0
- /package/{scss → theme}/config/mixins/_avatar.scss +0 -0
- /package/{scss → theme}/config/mixins/_breadcrumbs.scss +0 -0
- /package/{scss → theme}/config/mixins/_breakpoints.scss +0 -0
- /package/{scss → theme}/config/mixins/_chip.scss +0 -0
- /package/{scss → theme}/config/mixins/_circular-progress.scss +0 -0
- /package/{scss → theme}/config/mixins/_display.scss +0 -0
- /package/{scss → theme}/config/mixins/_empty-state.scss +0 -0
- /package/{scss → theme}/config/mixins/_focus.scss +0 -0
- /package/{scss → theme}/config/mixins/_interaction.scss +0 -0
- /package/{scss → theme}/config/mixins/_kbd.scss +0 -0
- /package/{scss → theme}/config/mixins/_link.scss +0 -0
- /package/{scss → theme}/config/mixins/_page-header.scss +0 -0
- /package/{scss → theme}/config/mixins/_position.scss +0 -0
- /package/{scss → theme}/config/mixins/_progress.scss +0 -0
- /package/{scss → theme}/config/mixins/_prose.scss +0 -0
- /package/{scss → theme}/config/mixins/_shadows.scss +0 -0
- /package/{scss → theme}/config/mixins/_sizing.scss +0 -0
- /package/{scss → theme}/config/mixins/_spacing.scss +0 -0
- /package/{scss → theme}/config/mixins/_stat-card.scss +0 -0
- /package/{scss → theme}/config/mixins/_stepper.scss +0 -0
- /package/{scss → theme}/config/mixins/_timeline.scss +0 -0
- /package/{scss → theme}/config/mixins/_transitions.scss +0 -0
- /package/{scss → theme}/config/mixins/_translations.scss +0 -0
- /package/{scss → theme}/tabler-icons.txt +0 -0
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
import { dispatch, getLocale, registerComponent, interceptValueProperty } from '../../ln-core';
|
|
2
|
-
|
|
3
|
-
(function () {
|
|
4
|
-
const DOM_SELECTOR = 'data-ln-number';
|
|
5
|
-
const DOM_ATTRIBUTE = 'lnNumber';
|
|
6
|
-
|
|
7
|
-
if (window[DOM_ATTRIBUTE] !== undefined) return;
|
|
8
|
-
|
|
9
|
-
// ─── Formatter Cache ──────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
const _formatters = {};
|
|
12
|
-
const _inputValueDesc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
|
13
|
-
|
|
14
|
-
function _getFormatter(locale) {
|
|
15
|
-
if (!_formatters[locale]) {
|
|
16
|
-
const fmt = new Intl.NumberFormat(locale, { useGrouping: true });
|
|
17
|
-
const parts = fmt.formatToParts(1234.5);
|
|
18
|
-
let groupSep = '';
|
|
19
|
-
let decimalSep = '.';
|
|
20
|
-
for (let i = 0; i < parts.length; i++) {
|
|
21
|
-
if (parts[i].type === 'group') groupSep = parts[i].value;
|
|
22
|
-
if (parts[i].type === 'decimal') decimalSep = parts[i].value;
|
|
23
|
-
}
|
|
24
|
-
_formatters[locale] = { fmt: fmt, groupSep: groupSep, decimalSep: decimalSep };
|
|
25
|
-
}
|
|
26
|
-
return _formatters[locale];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function _formatNum(locale, num, maxDecimals) {
|
|
30
|
-
if (maxDecimals !== null) {
|
|
31
|
-
const max = parseInt(maxDecimals, 10);
|
|
32
|
-
const key = locale + '|d' + max;
|
|
33
|
-
if (!_formatters[key]) {
|
|
34
|
-
_formatters[key] = new Intl.NumberFormat(locale, { useGrouping: true, minimumFractionDigits: 0, maximumFractionDigits: max });
|
|
35
|
-
}
|
|
36
|
-
return _formatters[key].format(num);
|
|
37
|
-
}
|
|
38
|
-
return _getFormatter(locale).fmt.format(num);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// ─── Component ─────────────────────────────────────────────
|
|
42
|
-
|
|
43
|
-
// ─── Component ─────────────────────────────────────────────
|
|
44
|
-
|
|
45
|
-
function _component(dom) {
|
|
46
|
-
if (dom[DOM_ATTRIBUTE]) return dom[DOM_ATTRIBUTE];
|
|
47
|
-
dom[DOM_ATTRIBUTE] = this;
|
|
48
|
-
this.dom = dom;
|
|
49
|
-
|
|
50
|
-
if (dom.tagName !== 'INPUT') {
|
|
51
|
-
this.isTextElement = true;
|
|
52
|
-
this._initTextElement();
|
|
53
|
-
return this;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ── Create hidden input ─────────────────────────────
|
|
57
|
-
const hidden = document.createElement('input');
|
|
58
|
-
hidden.type = 'hidden';
|
|
59
|
-
hidden.name = dom.name;
|
|
60
|
-
dom.removeAttribute('name');
|
|
61
|
-
if (dom.hasAttribute('data-ln-fill-as')) {
|
|
62
|
-
hidden.setAttribute('data-ln-fill-as', dom.getAttribute('data-ln-fill-as'));
|
|
63
|
-
}
|
|
64
|
-
dom.type = 'text';
|
|
65
|
-
dom.setAttribute('inputmode', 'decimal');
|
|
66
|
-
dom.insertAdjacentElement('afterend', hidden);
|
|
67
|
-
this._hidden = hidden;
|
|
68
|
-
|
|
69
|
-
// ── Intercept programmatic value sets on hidden input ──
|
|
70
|
-
const self = this;
|
|
71
|
-
Object.defineProperty(hidden, 'value', {
|
|
72
|
-
get: function () {
|
|
73
|
-
return _inputValueDesc.get.call(hidden);
|
|
74
|
-
},
|
|
75
|
-
set: function (val) {
|
|
76
|
-
_inputValueDesc.set.call(hidden, val); // store raw natively
|
|
77
|
-
if (val !== '' && !isNaN(parseFloat(val))) {
|
|
78
|
-
self._setDisplayRaw(_formatNum(getLocale(self.dom), parseFloat(val), self.dom.getAttribute('data-ln-number-decimals')));
|
|
79
|
-
} else {
|
|
80
|
-
self._setDisplayRaw('');
|
|
81
|
-
}
|
|
82
|
-
self.dom.dispatchEvent(new Event('input', { bubbles: true })); // single ecosystem signal → _handleInput emits ln-number:input
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// ── Intercept programmatic value sets on visible input (2-way binding) ──
|
|
87
|
-
interceptValueProperty(dom, _inputValueDesc, {
|
|
88
|
-
get: function () {
|
|
89
|
-
return _inputValueDesc.get.call(dom);
|
|
90
|
-
},
|
|
91
|
-
set: function (val) {
|
|
92
|
-
if (val === '') {
|
|
93
|
-
self._setDisplayRaw('');
|
|
94
|
-
self._setHiddenRaw('');
|
|
95
|
-
dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const num = typeof val === 'number' ? val : parseFloat(String(val).replace(/[^\d.-]/g, ''));
|
|
99
|
-
if (isNaN(num)) {
|
|
100
|
-
self._setDisplayRaw(String(val));
|
|
101
|
-
self._setHiddenRaw('');
|
|
102
|
-
} else {
|
|
103
|
-
self._setHiddenRaw(num);
|
|
104
|
-
self._setDisplayRaw(_formatNum(getLocale(dom), num, dom.getAttribute('data-ln-number-decimals')));
|
|
105
|
-
}
|
|
106
|
-
dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// ── Bind input event ────────────────────────────────
|
|
111
|
-
this._onInput = function () {
|
|
112
|
-
self._handleInput();
|
|
113
|
-
};
|
|
114
|
-
dom.addEventListener('input', this._onInput);
|
|
115
|
-
|
|
116
|
-
// ── Bind paste event ────────────────────────────────
|
|
117
|
-
this._onPaste = function (e) {
|
|
118
|
-
e.preventDefault();
|
|
119
|
-
const pasted = (e.clipboardData || window.clipboardData).getData('text');
|
|
120
|
-
const info = _getFormatter(getLocale(dom));
|
|
121
|
-
const decSepEscaped = info.decimalSep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
122
|
-
// Strip everything except digits, minus, and decimal separators
|
|
123
|
-
let cleaned = pasted.replace(new RegExp('[^0-9\\-' + decSepEscaped + '.]', 'g'), '');
|
|
124
|
-
// Strip group separators before normalizing decimal
|
|
125
|
-
if (info.groupSep) {
|
|
126
|
-
cleaned = cleaned.split(info.groupSep).join('');
|
|
127
|
-
}
|
|
128
|
-
// Normalize: if locale decimal is not '.', replace it
|
|
129
|
-
if (info.decimalSep !== '.') {
|
|
130
|
-
cleaned = cleaned.replace(info.decimalSep, '.');
|
|
131
|
-
}
|
|
132
|
-
const num = parseFloat(cleaned);
|
|
133
|
-
self.value = isNaN(num) ? NaN : num;
|
|
134
|
-
};
|
|
135
|
-
dom.addEventListener('paste', this._onPaste);
|
|
136
|
-
|
|
137
|
-
// ── Handle pre-filled value ─────────────────────────
|
|
138
|
-
const initial = dom.value;
|
|
139
|
-
if (initial !== '') {
|
|
140
|
-
const num = parseFloat(initial);
|
|
141
|
-
if (!isNaN(num)) {
|
|
142
|
-
this._setHiddenRaw(num);
|
|
143
|
-
this._setDisplayRaw(_formatNum(getLocale(dom), num, dom.getAttribute('data-ln-number-decimals')));
|
|
144
|
-
dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function _parseRawNumber(val) {
|
|
152
|
-
if (typeof val === 'number') return isNaN(val) ? null : val;
|
|
153
|
-
if (!val || typeof val !== 'string') return null;
|
|
154
|
-
let str = val.trim();
|
|
155
|
-
if (str === '') return null;
|
|
156
|
-
// Remove spaces/non-breaking spaces/currency symbols
|
|
157
|
-
str = str.replace(/[\s\u00A0$€£]/g, '');
|
|
158
|
-
|
|
159
|
-
// Handle "1.234,56" (DE/MK) vs "1,234.56" (EN)
|
|
160
|
-
if (str.indexOf(',') !== -1 && str.indexOf('.') !== -1) {
|
|
161
|
-
if (str.indexOf('.') < str.indexOf(',')) {
|
|
162
|
-
// DE/MK style: 1.234,56 -> 1234.56
|
|
163
|
-
str = str.replace(/\./g, '').replace(',', '.');
|
|
164
|
-
} else {
|
|
165
|
-
// EN style: 1,234.56 -> 1234.56
|
|
166
|
-
str = str.replace(/,/g, '');
|
|
167
|
-
}
|
|
168
|
-
} else if (str.indexOf(',') !== -1) {
|
|
169
|
-
// Only comma e.g. "1499,50" -> 1499.50
|
|
170
|
-
str = str.replace(',', '.');
|
|
171
|
-
}
|
|
172
|
-
// Strip any remaining invalid chars
|
|
173
|
-
str = str.replace(/[^\d.-]/g, '');
|
|
174
|
-
const num = parseFloat(str);
|
|
175
|
-
return isNaN(num) ? null : num;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
_component.prototype._initTextElement = function () {
|
|
179
|
-
const dom = this.dom;
|
|
180
|
-
let valAttr = dom.getAttribute('data-ln-value');
|
|
181
|
-
let numAttr = dom.getAttribute('data-ln-number');
|
|
182
|
-
|
|
183
|
-
let candidate = null;
|
|
184
|
-
if (valAttr !== null && valAttr !== '') {
|
|
185
|
-
candidate = valAttr;
|
|
186
|
-
} else if (numAttr !== null && numAttr !== '' && numAttr !== 'true') {
|
|
187
|
-
candidate = numAttr;
|
|
188
|
-
} else {
|
|
189
|
-
candidate = dom.textContent.trim();
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const num = _parseRawNumber(candidate);
|
|
193
|
-
if (num !== null) {
|
|
194
|
-
this._rawValue = num;
|
|
195
|
-
if (!dom.hasAttribute('data-ln-value')) {
|
|
196
|
-
dom.setAttribute('data-ln-value', String(num));
|
|
197
|
-
}
|
|
198
|
-
this._formatTextContent();
|
|
199
|
-
} else {
|
|
200
|
-
this._rawValue = null;
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
_component.prototype._formatTextContent = function () {
|
|
205
|
-
if (this._rawValue !== null && !isNaN(this._rawValue)) {
|
|
206
|
-
const decimals = this.dom.getAttribute('data-ln-number-decimals');
|
|
207
|
-
this.dom.textContent = _formatNum(getLocale(this.dom), this._rawValue, decimals);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
_component.prototype._handleInput = function () {
|
|
212
|
-
const dom = this.dom;
|
|
213
|
-
const info = _getFormatter(getLocale(dom));
|
|
214
|
-
const raw = _inputValueDesc.get.call(dom);
|
|
215
|
-
|
|
216
|
-
// Edge case: empty
|
|
217
|
-
if (raw === '') {
|
|
218
|
-
this._setHiddenRaw('');
|
|
219
|
-
dispatch(dom, 'ln-number:input', { value: NaN, formatted: '' });
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Edge case: just minus sign
|
|
224
|
-
if (raw === '-') {
|
|
225
|
-
this._setHiddenRaw('');
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// Save cursor context: count digits to the left of cursor
|
|
230
|
-
const cursorPos = dom.selectionStart;
|
|
231
|
-
let digitsBeforeCursor = 0;
|
|
232
|
-
for (let i = 0; i < cursorPos; i++) {
|
|
233
|
-
if (/[0-9]/.test(raw[i])) digitsBeforeCursor++;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// Parse: strip group separators, normalize decimal
|
|
237
|
-
let cleaned = raw;
|
|
238
|
-
if (info.groupSep) {
|
|
239
|
-
cleaned = cleaned.split(info.groupSep).join('');
|
|
240
|
-
}
|
|
241
|
-
cleaned = cleaned.replace(info.decimalSep, '.');
|
|
242
|
-
|
|
243
|
-
// Edge case: trailing decimal separator (user about to type decimals)
|
|
244
|
-
if (raw.endsWith(info.decimalSep) || raw.endsWith('.')) {
|
|
245
|
-
const beforeDecimal = cleaned.replace(/\.$/, '');
|
|
246
|
-
const num = parseFloat(beforeDecimal);
|
|
247
|
-
if (!isNaN(num)) {
|
|
248
|
-
this._setHiddenRaw(num);
|
|
249
|
-
}
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Edge case: trailing zeros after decimal (user still typing)
|
|
254
|
-
const decimalIndex = cleaned.indexOf('.');
|
|
255
|
-
if (decimalIndex !== -1) {
|
|
256
|
-
const afterDecimal = cleaned.slice(decimalIndex + 1);
|
|
257
|
-
if (afterDecimal.endsWith('0')) {
|
|
258
|
-
const num = parseFloat(cleaned);
|
|
259
|
-
if (!isNaN(num)) {
|
|
260
|
-
this._setHiddenRaw(num);
|
|
261
|
-
}
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// Enforce decimal limit
|
|
267
|
-
const maxDecimals = dom.getAttribute('data-ln-number-decimals');
|
|
268
|
-
if (maxDecimals !== null && decimalIndex !== -1) {
|
|
269
|
-
const allowed = parseInt(maxDecimals, 10);
|
|
270
|
-
const afterDec = cleaned.slice(decimalIndex + 1);
|
|
271
|
-
if (afterDec.length > allowed) {
|
|
272
|
-
cleaned = cleaned.slice(0, decimalIndex + 1 + allowed);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
const num = parseFloat(cleaned);
|
|
277
|
-
if (isNaN(num)) return;
|
|
278
|
-
|
|
279
|
-
// Enforce min/max
|
|
280
|
-
const minAttr = dom.getAttribute('data-ln-number-min');
|
|
281
|
-
const maxAttr = dom.getAttribute('data-ln-number-max');
|
|
282
|
-
if (minAttr !== null && num < parseFloat(minAttr)) return;
|
|
283
|
-
if (maxAttr !== null && num > parseFloat(maxAttr)) return;
|
|
284
|
-
|
|
285
|
-
// Format
|
|
286
|
-
let formatted;
|
|
287
|
-
if (maxDecimals !== null) {
|
|
288
|
-
formatted = _formatNum(getLocale(dom), num, maxDecimals);
|
|
289
|
-
} else {
|
|
290
|
-
// Preserve the user's decimal places
|
|
291
|
-
const userDecimals = decimalIndex !== -1 ? cleaned.slice(decimalIndex + 1).length : 0;
|
|
292
|
-
if (userDecimals > 0) {
|
|
293
|
-
const key = getLocale(dom) + '|u' + userDecimals;
|
|
294
|
-
if (!_formatters[key]) {
|
|
295
|
-
_formatters[key] = new Intl.NumberFormat(getLocale(dom), { useGrouping: true, minimumFractionDigits: userDecimals, maximumFractionDigits: userDecimals });
|
|
296
|
-
}
|
|
297
|
-
formatted = _formatters[key].format(num);
|
|
298
|
-
} else {
|
|
299
|
-
formatted = info.fmt.format(num);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
this._setDisplayRaw(formatted);
|
|
304
|
-
|
|
305
|
-
// Restore cursor position
|
|
306
|
-
let targetDigits = digitsBeforeCursor;
|
|
307
|
-
let newPos = 0;
|
|
308
|
-
for (let i = 0; i < formatted.length && targetDigits > 0; i++) {
|
|
309
|
-
newPos = i + 1;
|
|
310
|
-
if (/[0-9]/.test(formatted[i])) targetDigits--;
|
|
311
|
-
}
|
|
312
|
-
// If we didn't consume all digits, put cursor at end
|
|
313
|
-
if (targetDigits > 0) newPos = formatted.length;
|
|
314
|
-
dom.setSelectionRange(newPos, newPos);
|
|
315
|
-
|
|
316
|
-
// Update hidden input (bypass our setter to avoid feedback loop)
|
|
317
|
-
this._setHiddenRaw(num);
|
|
318
|
-
|
|
319
|
-
dispatch(dom, 'ln-number:input', { value: num, formatted: formatted });
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
_component.prototype._setHiddenRaw = function (val) {
|
|
323
|
-
if (this._hidden) {
|
|
324
|
-
_inputValueDesc.set.call(this._hidden, String(val));
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
_component.prototype._setDisplayRaw = function (str) {
|
|
329
|
-
if (this.isTextElement) {
|
|
330
|
-
this.dom.textContent = String(str);
|
|
331
|
-
} else {
|
|
332
|
-
_inputValueDesc.set.call(this.dom, String(str));
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
_component.prototype._displayFormatted = function (num) {
|
|
337
|
-
if (this.isTextElement) {
|
|
338
|
-
this._formatTextContent();
|
|
339
|
-
} else {
|
|
340
|
-
this._setDisplayRaw(_formatNum(getLocale(this.dom), num, this.dom.getAttribute('data-ln-number-decimals')));
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
// ─── Public API ───────────────────────────────────────────
|
|
345
|
-
|
|
346
|
-
Object.defineProperty(_component.prototype, 'value', {
|
|
347
|
-
get: function () {
|
|
348
|
-
if (this.isTextElement) {
|
|
349
|
-
return this._rawValue;
|
|
350
|
-
}
|
|
351
|
-
const raw = _inputValueDesc.get.call(this._hidden);
|
|
352
|
-
return raw === '' ? NaN : parseFloat(raw);
|
|
353
|
-
},
|
|
354
|
-
set: function (num) {
|
|
355
|
-
if (this.isTextElement) {
|
|
356
|
-
if (typeof num !== 'number' || isNaN(num)) {
|
|
357
|
-
this._rawValue = null;
|
|
358
|
-
this.dom.textContent = '';
|
|
359
|
-
} else {
|
|
360
|
-
this._rawValue = num;
|
|
361
|
-
this.dom.setAttribute('data-ln-value', String(num));
|
|
362
|
-
this._formatTextContent();
|
|
363
|
-
}
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
if (typeof num !== 'number' || isNaN(num)) {
|
|
368
|
-
this._setDisplayRaw('');
|
|
369
|
-
this._setHiddenRaw('');
|
|
370
|
-
this.dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
this._setHiddenRaw(num);
|
|
374
|
-
this._setDisplayRaw(_formatNum(getLocale(this.dom), num, this.dom.getAttribute('data-ln-number-decimals')));
|
|
375
|
-
this.dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
Object.defineProperty(_component.prototype, 'formatted', {
|
|
380
|
-
get: function () {
|
|
381
|
-
if (this.isTextElement) {
|
|
382
|
-
return this.dom.textContent;
|
|
383
|
-
}
|
|
384
|
-
return _inputValueDesc.get.call(this.dom);
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
_component.prototype.destroy = function () {
|
|
389
|
-
if (!this.dom[DOM_ATTRIBUTE]) return;
|
|
390
|
-
if (!this.isTextElement) {
|
|
391
|
-
this.dom.removeEventListener('input', this._onInput);
|
|
392
|
-
this.dom.removeEventListener('paste', this._onPaste);
|
|
393
|
-
if (this._hidden) {
|
|
394
|
-
this.dom.name = this._hidden.name;
|
|
395
|
-
this._hidden.remove();
|
|
396
|
-
}
|
|
397
|
-
this.dom.type = 'number';
|
|
398
|
-
this.dom.removeAttribute('inputmode');
|
|
399
|
-
}
|
|
400
|
-
dispatch(this.dom, 'ln-number:destroyed', { target: this.dom });
|
|
401
|
-
delete this.dom[DOM_ATTRIBUTE];
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
// ─── Locale Observer ──────────────────────────────────────
|
|
405
|
-
|
|
406
|
-
function _localeObserver() {
|
|
407
|
-
new MutationObserver(function () {
|
|
408
|
-
const els = document.querySelectorAll('[' + DOM_SELECTOR + ']');
|
|
409
|
-
for (let i = 0; i < els.length; i++) {
|
|
410
|
-
const inst = els[i][DOM_ATTRIBUTE];
|
|
411
|
-
if (inst) {
|
|
412
|
-
if (inst.isTextElement) {
|
|
413
|
-
inst._formatTextContent();
|
|
414
|
-
} else if (!isNaN(inst.value)) {
|
|
415
|
-
inst._displayFormatted(inst.value);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}).observe(document.documentElement, { attributes: true, attributeFilter: ['lang'], subtree: true });
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// ─── Init ──────────────────────────────────────────────────
|
|
423
|
-
|
|
424
|
-
registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-number', {
|
|
425
|
-
extraAttributes: [
|
|
426
|
-
'data-ln-value',
|
|
427
|
-
'data-ln-number-decimals',
|
|
428
|
-
'data-ln-number-min',
|
|
429
|
-
'data-ln-number-max',
|
|
430
|
-
'lang'
|
|
431
|
-
],
|
|
432
|
-
onAttributeChange: function (el) {
|
|
433
|
-
const inst = el[DOM_ATTRIBUTE];
|
|
434
|
-
if (!inst) return;
|
|
435
|
-
if (inst.isTextElement) {
|
|
436
|
-
inst._initTextElement();
|
|
437
|
-
} else if (!isNaN(inst.value)) {
|
|
438
|
-
inst._displayFormatted(inst.value);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
_localeObserver();
|
|
443
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const g={};function T(t,e){g[t]||(g[t]=document.querySelector('[data-ln-template="'+t+'"]'));const n=g[t];return n?n.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function q(t,e,n){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n||{}}))}function A(t,e){if(!t||!e)return t;const n=t.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const i=n[o],l=i.getAttribute("data-ln-field");e[l]!=null&&(i.textContent=e[l])}const c=t.querySelectorAll("[data-ln-attr]");for(let o=0;o<c.length;o++){const i=c[o],l=i.getAttribute("data-ln-attr").split(",");for(let d=0;d<l.length;d++){const r=l[d].trim().split(":");if(r.length!==2)continue;const u=r[0].trim(),f=r[1].trim();e[f]!=null&&i.setAttribute(u,e[f])}}const a=t.querySelectorAll("[data-ln-show]");for(let o=0;o<a.length;o++){const i=a[o],l=i.getAttribute("data-ln-show");l in e&&i.classList.toggle("hidden",!e[l])}const s=t.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const i=s[o],l=i.getAttribute("data-ln-class").split(",");for(let d=0;d<l.length;d++){const r=l[d].trim().split(":");if(r.length!==2)continue;const u=r[0].trim(),f=r[1].trim();f in e&&i.classList.toggle(u,!!e[f])}}return t}function F(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const n=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let c=0;c<n.length;c++)n[c].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)A(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let n=0;n<e.length;n++)e[n].textContent=""}})));function x(t,e){if(!t||!e)return t;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,i){return e[i]!==void 0?e[i]:""}))}const c=function(s,o){return e[o]!==void 0?e[o]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let s=0;s<a.length;s++){const o=a[s],i=o.attributes;for(let l=0;l<i.length;l++){const d=i[l];d.value.indexOf("{{")!==-1&&o.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,c))}}return t}function N(t,e,n,c,a,s){const o={};for(let l=0;l<t.children.length;l++){const d=t.children[l],r=d.getAttribute("data-ln-key");r&&(o[r]=d)}const i=document.createDocumentFragment();for(let l=0;l<e.length;l++){const d=e[l],r=String(c(d));let u=o[r];if(u)a(u,d,l);else{const f=T(n,s);if(!f||(x(f,d),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-key",r),a(u,d,l)}i.appendChild(u)}t.textContent="",t.appendChild(i)}function L(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function w(t,e,n,c){if(t.nodeType!==1)return;const s=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",o=Array.from(t.querySelectorAll(s));t.matches&&t.matches(s)&&o.push(t);for(const i of o)i[n]||(i[n]=new c(i))}function M(t,e,n,c,a={}){const s=a.extraAttributes||[],o=a.onAttributeChange||null,i=a.onInit||null;function l(d){const r=d||document.body;w(r,t,e,n),i&&i(r)}return L(function(){const d=new MutationObserver(function(u){for(let f=0;f<u.length;f++){const h=u[f];if(h.type==="childList"){for(let m=0;m<h.addedNodes.length;m++){const p=h.addedNodes[m];p.nodeType===1&&(w(p,t,e,n),i&&i(p))}for(let m=0;m<h.removedNodes.length;m++){const p=h.removedNodes[m];if(p.nodeType===1){const k=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",y=Array.from(p.querySelectorAll(k));p.matches&&p.matches(k)&&y.push(p);for(let C=0;C<y.length;C++){const D=y[C];if(!document.contains(D)){const v=D[e];v&&typeof v.destroy=="function"&&v.destroy()}}}}}else h.type==="attributes"&&(o&&h.target[e]?o(h.target,h.attributeName):(w(h.target,t,e,n),i&&i(h.target)))}});let r=[];if(t.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let f;for(;(f=u.exec(t))!==null;)r.push(f[1])}else r.push(t);d.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:r.concat(s)})},c),window[e]=l,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body),l}const S={};function j(t,e){S[t]=e}function W(t){return S[t]||{ingress:e=>e,egress:e=>e}}const _={};function E(t,e){if(!t||typeof e!="object")return;const n=t.toLowerCase().split("-")[0];_[n]=e}function B(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return _[e]||null}E("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W,window.lnCore.registerLocaleFallback=E,window.lnCore.getLocaleFallback=B,window.lnCore.fillTemplate=x,window.lnCore.fill=A,window.lnCore.lnFill=F,window.lnCore.renderList=N);function O(t){return(t||"").replace(/^#/,"")}function b(t){const e=t===void 0?location.hash:t,n={},c=O(e);if(!c)return n;const a=c.split("&");for(let s=0;s<a.length;s++){const o=a[s];if(!o)continue;const i=o.indexOf(":"),l=i>-1?o.slice(0,i):o,d=i>-1?o.slice(i+1):"";if(l)try{n[l]=decodeURIComponent(d)}catch{n[l]=d}}return n}function I(t){if(!t)return null;const e=b();return t in e?e[t]:null}function K(t,e){if(!t)return;const n=b();e==null?delete n[t]:n[t]=String(e);const a=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");O(location.hash)!==a&&(location.hash=a)}function R(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=b,window.lnCore.hashGet=I,window.lnCore.hashSet=K,window.lnCore.hashLinkClick=R),(function(){const t="data-ln-options",e="lnOptions";if(window[e]!==void 0)return;function n(c){this.dom=c,this._storeName=c.getAttribute(t),this._valueField=c.getAttribute("data-ln-options-value")||"id",this._labelField=c.getAttribute("data-ln-options-label")||"name";const a=this;return this._onSetData=function(s){a._rebuild(s.detail.data||[])},c.addEventListener("ln-options:set-data",this._onSetData),q(c,"ln-options:request-data",{options:this._storeName}),this}n.prototype._rebuild=function(c){const a=this.dom,s=this._valueField,o=this._labelField,i=a.value,l=a.querySelectorAll("option");for(let r=l.length-1;r>=0;r--)l[r].value!==""&&a.removeChild(l[r]);for(let r=0;r<c.length;r++){const u=c[r],f=document.createElement("option");f.value=String(u[s]),f.textContent=u[o]!=null?u[o]:"",a.appendChild(f)}const d=a.options;for(let r=0;r<d.length;r++)if(d[r].value===i){a.value=i;break}},n.prototype.destroy=function(){this.dom[e]&&(this.dom.removeEventListener("ln-options:set-data",this._onSetData),delete this.dom[e])},M(t,e,n,"ln-options")})()})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const A={};function N(t,e){A[t]||(A[t]=document.querySelector('[data-ln-template="'+t+'"]'));const s=A[t];return s?s.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function E(t,e,s){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s||{}}))}function k(t,e,s){const h=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s||{}});return t.dispatchEvent(h),h}function O(t,e){if(!t||!e)return t;const s=t.querySelectorAll("[data-ln-field]");for(let o=0;o<s.length;o++){const r=s[o],i=r.getAttribute("data-ln-field");e[i]!=null&&(r.textContent=e[i])}const h=t.querySelectorAll("[data-ln-attr]");for(let o=0;o<h.length;o++){const r=h[o],i=r.getAttribute("data-ln-attr").split(",");for(let f=0;f<i.length;f++){const n=i[f].trim().split(":");if(n.length!==2)continue;const u=n[0].trim(),d=n[1].trim();e[d]!=null&&r.setAttribute(u,e[d])}}const c=t.querySelectorAll("[data-ln-show]");for(let o=0;o<c.length;o++){const r=c[o],i=r.getAttribute("data-ln-show");i in e&&r.classList.toggle("hidden",!e[i])}const l=t.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const r=l[o],i=r.getAttribute("data-ln-class").split(",");for(let f=0;f<i.length;f++){const n=i[f].trim().split(":");if(n.length!==2)continue;const u=n[0].trim(),d=n[1].trim();d in e&&r.classList.toggle(u,!!e[d])}}return t}function W(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const s=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let h=0;h<s.length;h++)s[h].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)O(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let s=0;s<e.length;s++)e[s].textContent=""}})));function T(t,e){if(!t||!e)return t;const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;s.nextNode();){const l=s.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,r){return e[r]!==void 0?e[r]:""}))}const h=function(l,o){return e[o]!==void 0?e[o]:""},c=Array.from(t.querySelectorAll("*"));t.nodeType===1&&c.push(t);for(let l=0;l<c.length;l++){const o=c[l],r=o.attributes;for(let i=0;i<r.length;i++){const f=r[i];f.value.indexOf("{{")!==-1&&o.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,h))}}return t}function B(t,e,s,h,c,l){const o={};for(let i=0;i<t.children.length;i++){const f=t.children[i],n=f.getAttribute("data-ln-key");n&&(o[n]=f)}const r=document.createDocumentFragment();for(let i=0;i<e.length;i++){const f=e[i],n=String(h(f));let u=o[n];if(u)c(u,f,i);else{const d=N(s,l);if(!d||(T(d,f),u=d.firstElementChild,!u))continue;u.setAttribute("data-ln-key",n),c(u,f,i)}r.appendChild(u)}t.textContent="",t.appendChild(r)}function q(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){q(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function L(t,e,s,h){if(t.nodeType!==1)return;const l=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",o=Array.from(t.querySelectorAll(l));t.matches&&t.matches(l)&&o.push(t);for(const r of o)r[s]||(r[s]=new h(r))}function j(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function S(t,e,s,h,c={}){const l=c.extraAttributes||[],o=c.onAttributeChange||null,r=c.onInit||null;function i(f){const n=f||document.body;L(n,t,e,s),r&&r(n)}return q(function(){const f=new MutationObserver(function(u){for(let d=0;d<u.length;d++){const p=u[d];if(p.type==="childList"){for(let a=0;a<p.addedNodes.length;a++){const g=p.addedNodes[a];g.nodeType===1&&(L(g,t,e,s),r&&r(g))}for(let a=0;a<p.removedNodes.length;a++){const g=p.removedNodes[a];if(g.nodeType===1){const b=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",y=Array.from(g.querySelectorAll(b));g.matches&&g.matches(b)&&y.push(g);for(let m=0;m<y.length;m++){const v=y[m];if(!document.contains(v)){const C=v[e];C&&typeof C.destroy=="function"&&C.destroy()}}}}}else p.type==="attributes"&&(o&&p.target[e]?o(p.target,p.attributeName):(L(p.target,t,e,s),r&&r(p.target)))}});let n=[];if(t.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let d;for(;(d=u.exec(t))!==null;)n.push(d[1])}else n.push(t);f.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:n.concat(l)})},h||(t.indexOf("[")===-1?t.replace("data-",""):"component")),window[e]=i,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i(document.body)}):i(document.body),i}const D={};function K(t,e){D[t]=e}function H(t){return D[t]||{ingress:e=>e,egress:e=>e}}const R={};function I(t,e){if(!t||typeof e!="object")return;const s=t.toLowerCase().split("-")[0];R[s]=e}function G(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return R[e]||null}I("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=K,window.lnCore.getDataMapper=H,window.lnCore.registerLocaleFallback=I,window.lnCore.getLocaleFallback=G,window.lnCore.fillTemplate=T,window.lnCore.fill=O,window.lnCore.lnFill=W,window.lnCore.renderList=B);function F(t){return(t||"").replace(/^#/,"")}function x(t){const e=t===void 0?location.hash:t,s={},h=F(e);if(!h)return s;const c=h.split("&");for(let l=0;l<c.length;l++){const o=c[l];if(!o)continue;const r=o.indexOf(":"),i=r>-1?o.slice(0,r):o,f=r>-1?o.slice(r+1):"";if(i)try{s[i]=decodeURIComponent(f)}catch{s[i]=f}}return s}function z(t){if(!t)return null;const e=x();return t in e?e[t]:null}function U(t,e){if(!t)return;const s=x();e==null?delete s[t]:s[t]=String(e);const c=Object.keys(s).map(function(l){const o=s[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");F(location.hash)!==c&&(location.hash=c)}function V(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=z,window.lnCore.hashSet=U,window.lnCore.hashLinkClick=V);function P(t,e,s,h){const c=h,l=window.innerWidth,o=window.innerHeight,r=e.width,i=e.height,f=(s||"bottom").split("-"),n=f[0],u=f[1]==="start"||f[1]==="end"?f[1]:"center",d={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},p=d[n]||d.bottom;function a(m){return m==="top"||m==="bottom"?u==="start"?t.left:u==="end"?t.right-r:t.left+(t.width-r)/2:u==="start"?t.top:u==="end"?t.bottom-i:t.top+(t.height-i)/2}function g(m){let v,C,_=!0;return m==="top"?(v=t.top-c-i,C=a(m),v<0&&(_=!1)):m==="bottom"?(v=t.bottom+c,C=a(m),v+i>o&&(_=!1)):m==="left"?(v=a(m),C=t.left-c-r,C<0&&(_=!1)):(v=a(m),C=t.right+c,C+r>l&&(_=!1)),{top:v,left:C,side:m,fits:_}}let w=null;for(let m=0;m<p.length;m++){const v=g(p[m]);if(v.fits){w=v;break}}w||(w=g(p[0]));let b=w.top,y=w.left;return r>=l?y=0:(y<0&&(y=0),y+r>l&&(y=l-r)),i>=o?b=0:(b<0&&(b=0),b+i>o&&(b=o-i)),{top:b,left:y,placement:w.side}}function M(t){if(!t)return{width:0,height:0};const e=t.style,s=e.visibility,h=e.display,c=e.position;e.visibility="hidden",e.display="block",e.position="fixed";const l=t.offsetWidth,o=t.offsetHeight;return e.visibility=s,e.display=h,e.position=c,{width:l,height:o}}(function(){const t="data-ln-popover",e="lnPopover",s="data-ln-popover-for",h="data-ln-popover-position";if(window[e]!==void 0)return;const c=[];let l=null;function o(){l||(l=function(n){if(n.key!=="Escape"||c.length===0)return;c[c.length-1].close()},document.addEventListener("keydown",l))}function r(){c.length>0||l&&(document.removeEventListener("keydown",l),l=null)}function i(n){this.dom=n,this.isOpen=n.getAttribute(t)==="open",this.trigger=null,this._previousFocus=null,this._boundDocClick=null,this._docClickTimeout=null,this._boundReposition=null;const u=this;return this._onRequestOpen=function(d){const p=d.detail&&d.detail.trigger?d.detail.trigger:null;u.open(p)},this._onRequestClose=function(){u.close()},this._onRequestToggle=function(d){const p=d.detail&&d.detail.trigger?d.detail.trigger:null;u.toggle(p)},n.addEventListener("ln-popover:request-open",this._onRequestOpen),n.addEventListener("ln-popover:request-close",this._onRequestClose),n.addEventListener("ln-popover:request-toggle",this._onRequestToggle),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.hasAttribute("role")||n.setAttribute("role","dialog"),n.hasAttribute("popover")||n.setAttribute("popover","manual"),this.isOpen&&this._applyOpen(null),this}i.prototype.open=function(n){this.isOpen||(this.trigger=n||null,this.dom.setAttribute(t,"open"))},i.prototype.close=function(){this.isOpen&&this.dom.setAttribute(t,"closed")},i.prototype.toggle=function(n){this.isOpen?this.close():this.open(n)},i.prototype._applyOpen=function(n){this.isOpen=!0,n&&(this.trigger=n),this._previousFocus=document.activeElement,typeof this.dom.showPopover=="function"&&this.dom.showPopover();const u=M(this.dom);if(this.trigger){const g=this.trigger.getBoundingClientRect(),w=this.dom.getAttribute(h)||"bottom",b=P(g,u,w,8);this.dom.style.top=b.top+"px",this.dom.style.left=b.left+"px",this.dom.setAttribute("data-ln-popover-placement",b.placement),this.trigger.setAttribute("aria-expanded","true")}const d=this.dom.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),p=Array.prototype.find.call(d,j);p?p.focus():this.dom.focus();const a=this;this._boundDocClick=function(g){a.dom.contains(g.target)||a.trigger&&a.trigger.contains(g.target)||a.close()},a._docClickTimeout=setTimeout(function(){a._docClickTimeout=null,document.addEventListener("click",a._boundDocClick)},0),this._boundReposition=function(){if(!a.trigger)return;const g=a.trigger.getBoundingClientRect(),w=M(a.dom),b=a.dom.getAttribute(h)||"bottom",y=P(g,w,b,8);a.dom.style.top=y.top+"px",a.dom.style.left=y.left+"px",a.dom.setAttribute("data-ln-popover-placement",y.placement)},window.addEventListener("scroll",this._boundReposition,{passive:!0,capture:!0}),window.addEventListener("resize",this._boundReposition),c.push(this),o(),E(this.dom,"ln-popover:open",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger})},i.prototype._applyClose=function(){this.isOpen=!1,this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null),this._boundReposition&&(window.removeEventListener("scroll",this._boundReposition,{capture:!0}),window.removeEventListener("resize",this._boundReposition),this._boundReposition=null),this.dom.style.top="",this.dom.style.left="",this.dom.removeAttribute("data-ln-popover-placement"),this.trigger&&this.trigger.setAttribute("aria-expanded","false"),typeof this.dom.hidePopover=="function"&&this.dom.matches(":popover-open")&&this.dom.hidePopover();const n=c.indexOf(this);n!==-1&&c.splice(n,1),r(),this._previousFocus&&this.trigger&&this._previousFocus===this.trigger?this.trigger.focus():this.trigger&&document.activeElement===document.body&&this.trigger.focus(),this._previousFocus=null,E(this.dom,"ln-popover:close",{popoverId:this.dom.id,target:this.dom,trigger:this.trigger}),this.trigger=null},i.prototype.destroy=function(){this.dom[e]&&(this.dom.removeEventListener("ln-popover:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-popover:request-close",this._onRequestClose),this.dom.removeEventListener("ln-popover:request-toggle",this._onRequestToggle),this.isOpen&&this._applyClose(),delete this.dom[e],E(this.dom,"ln-popover:destroyed",{popoverId:this.dom.id,target:this.dom}))};function f(n){this.dom=n;const u=n.getAttribute(s);return n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls",u),this._onClick=function(d){if(d.ctrlKey||d.metaKey||d.button===1)return;d.preventDefault();const p=document.getElementById(u);if(!p)return;p[e]&&(p[e].trigger=n);const a=p.getAttribute(t);p.setAttribute(t,a==="open"?"closed":"open")},n.addEventListener("click",this._onClick),this}f.prototype.destroy=function(){this.dom.removeEventListener("click",this._onClick),delete this.dom[e+"Trigger"]},S(t,e,i,"ln-popover",{onAttributeChange:function(n){const u=n[e];if(!u)return;const p=n.getAttribute(t)==="open";if(p!==u.isOpen)if(p){if(k(n,"ln-popover:before-open",{popoverId:n.id,target:n,trigger:u.trigger}).defaultPrevented){n.setAttribute(t,"closed");return}u._applyOpen(u.trigger)}else{if(k(n,"ln-popover:before-close",{popoverId:n.id,target:n,trigger:u.trigger}).defaultPrevented){n.setAttribute(t,"open");return}u._applyClose()}}}),S(s,e+"Trigger",f,"ln-popover-trigger")})()})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const g={};function T(t,e){g[t]||(g[t]=document.querySelector('[data-ln-template="'+t+'"]'));const o=g[t];return o?o.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function q(t,e,o){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o||{}}))}function v(t,e){if(!t||!e)return t;const o=t.querySelectorAll("[data-ln-field]");for(let n=0;n<o.length;n++){const r=o[n],i=r.getAttribute("data-ln-field");e[i]!=null&&(r.textContent=e[i])}const u=t.querySelectorAll("[data-ln-attr]");for(let n=0;n<u.length;n++){const r=u[n],i=r.getAttribute("data-ln-attr").split(",");for(let s=0;s<i.length;s++){const a=i[s].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();e[f]!=null&&r.setAttribute(d,e[f])}}const c=t.querySelectorAll("[data-ln-show]");for(let n=0;n<c.length;n++){const r=c[n],i=r.getAttribute("data-ln-show");i in e&&r.classList.toggle("hidden",!e[i])}const l=t.querySelectorAll("[data-ln-class]");for(let n=0;n<l.length;n++){const r=l[n],i=r.getAttribute("data-ln-class").split(",");for(let s=0;s<i.length;s++){const a=i[s].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in e&&r.classList.toggle(d,!!e[f])}}return t}function D(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const o=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let u=0;u<o.length;u++)o[u].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)v(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let o=0;o<e.length;o++)e[o].textContent=""}})));function A(t,e){if(!t||!e)return t;const o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const l=o.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,r){return e[r]!==void 0?e[r]:""}))}const u=function(l,n){return e[n]!==void 0?e[n]:""},c=Array.from(t.querySelectorAll("*"));t.nodeType===1&&c.push(t);for(let l=0;l<c.length;l++){const n=c[l],r=n.attributes;for(let i=0;i<r.length;i++){const s=r[i];s.value.indexOf("{{")!==-1&&n.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,u))}}return t}function N(t,e,o,u,c,l){const n={};for(let i=0;i<t.children.length;i++){const s=t.children[i],a=s.getAttribute("data-ln-key");a&&(n[a]=s)}const r=document.createDocumentFragment();for(let i=0;i<e.length;i++){const s=e[i],a=String(u(s));let d=n[a];if(d)c(d,s,i);else{const f=T(o,l);if(!f||(A(f,s),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-key",a),c(d,s,i)}r.appendChild(d)}t.textContent="",t.appendChild(r)}function O(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function b(t,e,o,u){if(t.nodeType!==1)return;const l=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",n=Array.from(t.querySelectorAll(l));t.matches&&t.matches(l)&&n.push(t);for(const r of n)r[o]||(r[o]=new u(r))}function F(t,e,o,u,c={}){const l=c.extraAttributes||[],n=c.onAttributeChange||null,r=c.onInit||null;function i(s){const a=s||document.body;b(a,t,e,o),r&&r(a)}return O(function(){const s=new MutationObserver(function(d){for(let f=0;f<d.length;f++){const h=d[f];if(h.type==="childList"){for(let m=0;m<h.addedNodes.length;m++){const p=h.addedNodes[m];p.nodeType===1&&(b(p,t,e,o),r&&r(p))}for(let m=0;m<h.removedNodes.length;m++){const p=h.removedNodes[m];if(p.nodeType===1){const k=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",y=Array.from(p.querySelectorAll(k));p.matches&&p.matches(k)&&y.push(p);for(let C=0;C<y.length;C++){const M=y[C];if(!document.contains(M)){const x=M[e];x&&typeof x.destroy=="function"&&x.destroy()}}}}}else h.type==="attributes"&&(n&&h.target[e]?n(h.target,h.attributeName):(b(h.target,t,e,o),r&&r(h.target)))}});let a=[];if(t.indexOf("[")!==-1){const d=/\[([\w-]+)/g;let f;for(;(f=d.exec(t))!==null;)a.push(f[1])}else a.push(t);s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:a.concat(l)})},u),window[e]=i,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i(document.body)}):i(document.body),i}const L={};function j(t,e){L[t]=e}function W(t){return L[t]||{ingress:e=>e,egress:e=>e}}const _={};function S(t,e){if(!t||typeof e!="object")return;const o=t.toLowerCase().split("-")[0];_[o]=e}function B(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return _[e]||null}S("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W,window.lnCore.registerLocaleFallback=S,window.lnCore.getLocaleFallback=B,window.lnCore.fillTemplate=A,window.lnCore.fill=v,window.lnCore.lnFill=D,window.lnCore.renderList=N);function E(t){return(t||"").replace(/^#/,"")}function w(t){const e=t===void 0?location.hash:t,o={},u=E(e);if(!u)return o;const c=u.split("&");for(let l=0;l<c.length;l++){const n=c[l];if(!n)continue;const r=n.indexOf(":"),i=r>-1?n.slice(0,r):n,s=r>-1?n.slice(r+1):"";if(i)try{o[i]=decodeURIComponent(s)}catch{o[i]=s}}return o}function I(t){if(!t)return null;const e=w();return t in e?e[t]:null}function K(t,e){if(!t)return;const o=w();e==null?delete o[t]:o[t]=String(e);const c=Object.keys(o).map(function(l){const n=o[l];return n===""?l:l+":"+encodeURIComponent(n)}).join("&");E(location.hash)!==c&&(location.hash=c)}function R(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=w,window.lnCore.hashGet=I,window.lnCore.hashSet=K,window.lnCore.hashLinkClick=R),(function(){const t="[data-ln-progress]",e="lnProgress";if(window[e]!==void 0)return;function o(n){return this.dom=n,this._attrObserver=null,this._parentObserver=null,l.call(this),u.call(this),c.call(this),this}o.prototype.destroy=function(){this.dom[e]&&(this._attrObserver&&this._attrObserver.disconnect(),this._parentObserver&&this._parentObserver.disconnect(),delete this.dom[e])};function u(){const n=this,r=new MutationObserver(function(i){for(const s of i)(s.attributeName==="data-ln-progress"||s.attributeName==="data-ln-progress-max")&&l.call(n)});r.observe(this.dom,{attributes:!0,attributeFilter:["data-ln-progress","data-ln-progress-max"]}),this._attrObserver=r}function c(){const n=this,r=this.dom.parentElement;if(!r)return;const i=new MutationObserver(function(s){for(const a of s)a.attributeName==="data-ln-progress-max"&&l.call(n)});i.observe(r,{attributes:!0,attributeFilter:["data-ln-progress-max"]}),this._parentObserver=i}function l(){const n=parseFloat(this.dom.getAttribute("data-ln-progress"))||0,r=this.dom.parentElement,s=(r&&r.hasAttribute("data-ln-progress-max")?parseFloat(r.getAttribute("data-ln-progress-max")):null)||parseFloat(this.dom.getAttribute("data-ln-progress-max"))||100;let a=s>0?n/s*100:0;a<0&&(a=0),a>100&&(a=100),this.dom.style.width=a+"%";const d=Math.max(0,Math.min(n,s));this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin","0"),this.dom.setAttribute("aria-valuemax",String(s)),this.dom.setAttribute("aria-valuenow",String(d)),q(this.dom,"ln-progress:change",{target:this.dom,value:n,max:s,percentage:a})}F(t,e,o,"ln-progress")})()})();
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { dispatch, registerComponent } from '../../ln-core';
|
|
2
|
-
|
|
3
|
-
(function () {
|
|
4
|
-
const DOM_SELECTOR = '[data-ln-progress]';
|
|
5
|
-
const DOM_ATTRIBUTE = 'lnProgress';
|
|
6
|
-
|
|
7
|
-
if (window[DOM_ATTRIBUTE] !== undefined) return;
|
|
8
|
-
|
|
9
|
-
function _constructor(dom) {
|
|
10
|
-
this.dom = dom;
|
|
11
|
-
this._attrObserver = null;
|
|
12
|
-
this._parentObserver = null;
|
|
13
|
-
_render.call(this);
|
|
14
|
-
_listenValues.call(this);
|
|
15
|
-
_listenParent.call(this);
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
_constructor.prototype.destroy = function () {
|
|
20
|
-
if (!this.dom[DOM_ATTRIBUTE]) return;
|
|
21
|
-
if (this._attrObserver) {
|
|
22
|
-
this._attrObserver.disconnect();
|
|
23
|
-
}
|
|
24
|
-
if (this._parentObserver) {
|
|
25
|
-
this._parentObserver.disconnect();
|
|
26
|
-
}
|
|
27
|
-
delete this.dom[DOM_ATTRIBUTE];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function _listenValues() {
|
|
31
|
-
const self = this;
|
|
32
|
-
const observer = new MutationObserver(function (mutations) {
|
|
33
|
-
for (const mutation of mutations) {
|
|
34
|
-
if (mutation.attributeName === 'data-ln-progress' || mutation.attributeName === 'data-ln-progress-max') {
|
|
35
|
-
_render.call(self);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
observer.observe(this.dom, {
|
|
41
|
-
attributes: true,
|
|
42
|
-
attributeFilter: ['data-ln-progress', 'data-ln-progress-max']
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
this._attrObserver = observer;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _listenParent() {
|
|
49
|
-
const self = this;
|
|
50
|
-
const parent = this.dom.parentElement;
|
|
51
|
-
if (!parent) return;
|
|
52
|
-
|
|
53
|
-
const observer = new MutationObserver(function (mutations) {
|
|
54
|
-
for (const mutation of mutations) {
|
|
55
|
-
if (mutation.attributeName === 'data-ln-progress-max') {
|
|
56
|
-
_render.call(self);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
observer.observe(parent, {
|
|
62
|
-
attributes: true,
|
|
63
|
-
attributeFilter: ['data-ln-progress-max']
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
this._parentObserver = observer;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _render() {
|
|
70
|
-
const value = parseFloat(this.dom.getAttribute('data-ln-progress')) || 0;
|
|
71
|
-
const parent = this.dom.parentElement;
|
|
72
|
-
const parentMax = parent && parent.hasAttribute('data-ln-progress-max')
|
|
73
|
-
? parseFloat(parent.getAttribute('data-ln-progress-max'))
|
|
74
|
-
: null;
|
|
75
|
-
const max = parentMax || parseFloat(this.dom.getAttribute('data-ln-progress-max')) || 100;
|
|
76
|
-
let percentage = (max > 0) ? (value / max) * 100 : 0;
|
|
77
|
-
|
|
78
|
-
if (percentage < 0) percentage = 0;
|
|
79
|
-
if (percentage > 100) percentage = 100;
|
|
80
|
-
|
|
81
|
-
this.dom.style.width = percentage + '%';
|
|
82
|
-
|
|
83
|
-
const clampedValue = Math.max(0, Math.min(value, max));
|
|
84
|
-
this.dom.setAttribute('role', 'progressbar');
|
|
85
|
-
this.dom.setAttribute('aria-valuemin', '0');
|
|
86
|
-
this.dom.setAttribute('aria-valuemax', String(max));
|
|
87
|
-
this.dom.setAttribute('aria-valuenow', String(clampedValue));
|
|
88
|
-
|
|
89
|
-
dispatch(this.dom, 'ln-progress:change', { target: this.dom, value: value, max: max, percentage: percentage });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
registerComponent(
|
|
93
|
-
DOM_SELECTOR,
|
|
94
|
-
DOM_ATTRIBUTE,
|
|
95
|
-
_constructor,
|
|
96
|
-
'ln-progress'
|
|
97
|
-
);
|
|
98
|
-
})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var LnAshlarComponent=(function(b){"use strict";if(typeof window<"u"){const t=console.warn;console.warn=function(...e){typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))&&!(document.documentElement.hasAttribute("data-ln-debug")||document.body&&document.body.hasAttribute("data-ln-debug"))||t.apply(console,e)}}const _={};function Y(t,e){_[t]||(_[t]=document.querySelector('[data-ln-template="'+t+'"]'));const n=_[t];return n?n.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function R(t,e,n){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n||{}}))}function Z(t,e,n){const s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n||{}});return t.dispatchEvent(s),s}function D(t,e){if(!t||!e)return t;const n=t.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const l=n[o],a=l.getAttribute("data-ln-field");e[a]!=null&&(l.textContent=e[a])}const s=t.querySelectorAll("[data-ln-attr]");for(let o=0;o<s.length;o++){const l=s[o],a=l.getAttribute("data-ln-attr").split(",");for(let c=0;c<a.length;c++){const d=a[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();e[f]!=null&&l.setAttribute(u,e[f])}}const r=t.querySelectorAll("[data-ln-show]");for(let o=0;o<r.length;o++){const l=r[o],a=l.getAttribute("data-ln-show");a in e&&l.classList.toggle("hidden",!e[a])}const i=t.querySelectorAll("[data-ln-class]");for(let o=0;o<i.length;o++){const l=i[o],a=l.getAttribute("data-ln-class").split(",");for(let c=0;c<a.length;c++){const d=a[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in e&&l.classList.toggle(u,!!e[f])}}return t}function tt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));const n=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let s=0;s<n.length;s++)n[s].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)D(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let n=0;n<e.length;n++)e[n].textContent=""}})));function W(t,e){if(!t||!e)return t;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,l){return e[l]!==void 0?e[l]:""}))}const s=function(i,o){return e[o]!==void 0?e[o]:""},r=Array.from(t.querySelectorAll("*"));t.nodeType===1&&r.push(t);for(let i=0;i<r.length;i++){const o=r[i],l=o.attributes;for(let a=0;a<l.length;a++){const c=l[a];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,s))}}return t}function et(t,e,n,s,r,i){const o={};for(let a=0;a<t.children.length;a++){const c=t.children[a],d=c.getAttribute("data-ln-key");d&&(o[d]=c)}const l=document.createDocumentFragment();for(let a=0;a<e.length;a++){const c=e[a],d=String(s(c));let u=o[d];if(u)r(u,c,a);else{const f=Y(n,i);if(!f||(W(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-key",d),r(u,c,a)}l.appendChild(u)}t.textContent="",t.appendChild(l)}function A(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function C(t,e,n,s){if(t.nodeType!==1)return;const i=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",o=Array.from(t.querySelectorAll(i));t.matches&&t.matches(i)&&o.push(t);for(const l of o)l[n]||(l[n]=new s(l))}function nt(t,e,n,s,r={}){const i=r.extraAttributes||[],o=r.onAttributeChange||null,l=r.onInit||null;function a(c){const d=c||document.body;C(d,t,e,n),l&&l(d)}return A(function(){const c=new MutationObserver(function(u){for(let f=0;f<u.length;f++){const h=u[f];if(h.type==="childList"){for(let p=0;p<h.addedNodes.length;p++){const m=h.addedNodes[p];m.nodeType===1&&(C(m,t,e,n),l&&l(m))}for(let p=0;p<h.removedNodes.length;p++){const m=h.removedNodes[p];if(m.nodeType===1){const X=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",q=Array.from(m.querySelectorAll(X));m.matches&&m.matches(X)&&q.push(m);for(let M=0;M<q.length;M++){const J=q[M];if(!document.contains(J)){const T=J[e];T&&typeof T.destroy=="function"&&T.destroy()}}}}}else h.type==="attributes"&&(o&&h.target[e]?o(h.target,h.attributeName):(C(h.target,t,e,n),l&&l(h.target)))}});let d=[];if(t.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let f;for(;(f=u.exec(t))!==null;)d.push(f[1])}else d.push(t);c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:d.concat(i)})},s),window[e]=a,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){a(document.body)}):a(document.body),a}function rt(t,e){if(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||t.button!==0||!e)return!1;const n=e.getAttribute("href");return!(!n||e.getAttribute("target")==="_blank"||e.hasAttribute("download")||n.startsWith("mailto:")||n.startsWith("tel:")||n==="#"||n.startsWith("#")||e.hostname&&e.hostname!==window.location.hostname)}const I={};function ot(t,e){I[t]=e}function it(t){return I[t]||{ingress:e=>e,egress:e=>e}}const N={};function j(t,e){if(!t||typeof e!="object")return;const n=t.toLowerCase().split("-")[0];N[n]=e}function st(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return N[e]||null}j("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ot,window.lnCore.getDataMapper=it,window.lnCore.registerLocaleFallback=j,window.lnCore.getLocaleFallback=st,window.lnCore.fillTemplate=W,window.lnCore.fill=D,window.lnCore.lnFill=tt,window.lnCore.renderList=et);function K(t){return(t||"").replace(/^#/,"")}function S(t){const e=t===void 0?location.hash:t,n={},s=K(e);if(!s)return n;const r=s.split("&");for(let i=0;i<r.length;i++){const o=r[i];if(!o)continue;const l=o.indexOf(":"),a=l>-1?o.slice(0,l):o,c=l>-1?o.slice(l+1):"";if(a)try{n[a]=decodeURIComponent(c)}catch{n[a]=c}}return n}function lt(t){if(!t)return null;const e=S();return t in e?e[t]:null}function at(t,e){if(!t)return;const n=S();e==null?delete n[t]:n[t]=String(e);const r=Object.keys(n).map(function(i){const o=n[i];return o===""?i:i+":"+encodeURIComponent(o)}).join("&");K(location.hash)!==r&&(location.hash=r)}function ct(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=lt,window.lnCore.hashSet=at,window.lnCore.hashLinkClick=ct);const v={navigate:function(t){y(t,{historyAction:"push"})},replace:function(t){y(t,{historyAction:"replace"})},current:function(){return E?{path:x,params:F,query:U,route:E,regions:H}:null}},k="data-ln-route",P="lnRoute";typeof window<"u"&&(window.lnRouter=v);const g=new Map,B=new WeakMap;let H=new Map,$=!1,x=null,F={},U={},E=null,L=!1;function z(t,e,n){L?queueMicrotask(function(){R(t,e,n)}):R(t,e,n)}function w(t){try{const i=new URL(t,window.location.origin);t=i.pathname+i.search+i.hash}catch{}let[e]=t.split("#"),[n,s]=e.split("?");const r={};if(s){const i=new URLSearchParams(s);for(const[o,l]of i.entries())r[o]=l}return n=n.replace(/\/+$/,""),n===""&&(n="/"),{path:n,query:r}}function V(t,e){if(t.pattern==="*")return 1;if(e.pattern==="*")return-1;const n=t.segments,s=e.segments,r=Math.max(n.length,s.length);for(let i=0;i<r;i++){const o=n[i],l=s[i];if(o===void 0)return 1;if(l===void 0)return-1;if(o==="*")return 1;if(l==="*")return-1;const a=o.startsWith(":"),c=l.startsWith(":");if(a&&!c)return 1;if(!a&&c)return-1}return 0}function G(t,e){const n=t.split("/").filter(Boolean);for(const s of e){if(s.pattern==="*")return{route:s,params:{wildcard:t}};const r=s.segments,i={};let o=!0;if(!(n.length>r.length&&r[r.length-1]!=="*")){for(let l=0;l<r.length;l++){const a=r[l],c=n[l];if(a==="*"){i.wildcard=n.slice(l).join("/");break}if(c===void 0){o=!1;break}if(a.startsWith(":"))i[a.slice(1)]=decodeURIComponent(c);else if(a!==c){o=!1;break}}if(o&&(r.indexOf("*")!==-1||n.length<=r.length))return{route:s,params:i}}}return null}function O(t,e){if(t!=="__primary__"){const s=document.getElementById(e.target);return s||console.warn(`[ln-router] Explicit target element #${e.target} not found in DOM`),s}const n=document.querySelector("[data-ln-outlet]")||document.querySelector("main");return n||console.warn("[ln-router] Default outlet (element with [data-ln-outlet] or <main>) not found in DOM"),n}function ut(t){if(!t)return;const e=Array.from(t.querySelectorAll("*")),n=[t].concat(e);for(const r of n)for(const i of Object.keys(r))if(i.startsWith("ln")&&r[i]&&typeof r[i].destroy=="function")try{r[i].destroy()}catch(o){console.error(`[ln-router] Error destroying component ${i} on element:`,r,o)}const s=document.querySelectorAll('[data-ln-popover="open"]');for(const r of s){const i=r.lnPopover;if(i&&i.trigger&&t.contains(i.trigger))try{i.destroy()}catch(o){console.error("[ln-router] Error destroying open popover:",o)}}}function y(t,e={}){const{path:n,query:s}=w(t),r=new Map;for(const[d,u]of g)r.set(d,G(n,u.sorted));const i=g.has("__primary__"),o=r.get("__primary__");if(i&&!o){z(document.body,"ln-router:not-found",{path:n});return}let l=null;if(o&&(l=O("__primary__",o.route),!l||Z(l,"ln-router:before-navigate",{from:x,to:t,params:o.params,query:s}).defaultPrevented))return;const a=[];for(const[d,u]of r){if(!u)continue;const f=O(d,u.route);f&&(d!=="__primary__"&&f.hasAttribute("data-ln-route-keep")&&B.get(f)===u.route.templateNode||a.push({regionKey:d,match:u,targetEl:f}))}e.historyAction==="push"?window.history.pushState(null,"",t):e.historyAction==="replace"&&window.history.replaceState(null,"",t);const c=function(){for(const{regionKey:d,match:u,targetEl:f}of a){if(!(e.isHydration&&f.hasAttribute("data-ln-router-hydrate")&&f.children.length>0)){ut(f);const p=u.route.templateNode.content.cloneNode(!0);f.replaceChildren(p)}if(B.set(f,u.route.templateNode),d==="__primary__"&&(u.route.title&&(document.title=u.route.title),!e.isHydration)){f.hasAttribute("tabindex")||f.setAttribute("tabindex","-1");const p=f.querySelector("h1, h2, h3, h4, h5, h6");p?(p.setAttribute("tabindex","-1"),p.focus()):f.focus(),f.scrollIntoView({block:"start",behavior:"instant"})}z(f,"ln-router:navigated",{path:t,params:u.params,query:s,route:u.route,target:f,region:d})}o&&(x=t,F=o.params,U=s,E=o.route),H=new Map(Array.from(r.entries()).map(([d,u])=>[d,u?{route:u.route,params:u.params}:null]))};document.startViewTransition&&!e.isHydration?document.startViewTransition(c):c()}function ft(t){const e=t.target.closest("a");if(!e||!rt(t,e))return;const n=e.getAttribute("href"),{path:s}=w(n),r=g.get("__primary__");if(!r)return;G(s,r.sorted)&&(t.preventDefault(),y(n,{historyAction:"push"}))}function dt(t,e){const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(let r=0;r<n.length;r++){const i=n[r];if(t[i]!==e[i])return!1}return!0}function ht(){const t=window.location.pathname+window.location.search,e=v.current();if(e&&e.path!=null){const n=w(t);if(w(e.path).path===n.path&&dt(e.query,n.query))return}y(t,{historyAction:"skip"})}function pt(){$||($=!0,A(function(){document.addEventListener("click",ft),window.addEventListener("popstate",ht),L=!0;const t=window.location.pathname+window.location.search+window.location.hash;y(t,{historyAction:"replace",isHydration:!0}),L=!1},"ln-router"))}function gt(t){const e=t.getAttribute(k);if(!e)return;const n=t.getAttribute("data-ln-route-target")||null;if(n==="__primary__"){console.warn(`[ln-router] "__primary__" is a reserved region key and cannot be used as data-ln-route-target. Route "${e}" rejected.`);return}const s=n||"__primary__";g.has(s)||g.set(s,{routes:new Map,sorted:[]});const r=g.get(s);if(r.routes.has(e)){console.warn(`[ln-router] Duplicate route pattern registered: "${e}" in region "${s}"`);return}const i=t.getAttribute("data-ln-route-title"),o=e.split("/").filter(Boolean),l={pattern:e,segments:o,target:n,title:i,templateNode:t},a=O(s,l);a&&a.contains(t)&&console.warn(`[ln-router] Route template with pattern "${e}" is declared inside its own outlet element:`,t),r.routes.set(e,l),r.sorted=Array.from(r.routes.values()).sort(V)}function mt(t){const e=t.getAttribute(k);if(!e)return;const s=t.getAttribute("data-ln-route-target")||null||"__primary__",r=g.get(s);r&&(r.routes.delete(e),r.sorted=Array.from(r.routes.values()).sort(V),r.routes.size===0&&g.delete(s))}function Q(t){return this.dom=t,gt(t),this}return Q.prototype.destroy=function(){mt(this.dom),delete this.dom[P]},nt(k,P,Q,"ln-router",{extraAttributes:["data-ln-route-target","data-ln-route-title"],onInit:function(){g.size>0&&pt()}}),b.router=v,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b})({});
|