@livenetworks/ashlar 1.6.0 → 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/components/ln-confirm/README.md +216 -0
- 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 -167
- 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/README.md +0 -162
- 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,603 +0,0 @@
|
|
|
1
|
-
import { dispatch, getLocale, registerComponent, interceptValueProperty, getLocaleFallback, registerLocaleFallback, buildDict } from '../../ln-core';
|
|
2
|
-
|
|
3
|
-
(function () {
|
|
4
|
-
const DOM_SELECTOR = 'data-ln-date';
|
|
5
|
-
const DOM_ATTRIBUTE = 'lnDate';
|
|
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, options) {
|
|
15
|
-
const key = locale + '|' + JSON.stringify(options);
|
|
16
|
-
if (!_formatters[key]) {
|
|
17
|
-
_formatters[key] = new Intl.DateTimeFormat(locale, options);
|
|
18
|
-
}
|
|
19
|
-
return _formatters[key];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// ─── Format Detection ─────────────────────────────────────
|
|
23
|
-
|
|
24
|
-
const KEYWORD_RE = /^(short|medium|long)(\s+datetime)?$/;
|
|
25
|
-
|
|
26
|
-
const KEYWORD_OPTIONS = {
|
|
27
|
-
'short': { dateStyle: 'short' },
|
|
28
|
-
'medium': { dateStyle: 'medium' },
|
|
29
|
-
'long': { dateStyle: 'long' },
|
|
30
|
-
'short datetime': { dateStyle: 'short', timeStyle: 'short' },
|
|
31
|
-
'medium datetime': { dateStyle: 'medium', timeStyle: 'short' },
|
|
32
|
-
'long datetime': { dateStyle: 'long', timeStyle: 'short' }
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function _getIntlOptions(format) {
|
|
36
|
-
if (!format || format === '') return { dateStyle: 'medium' };
|
|
37
|
-
const match = format.match(KEYWORD_RE);
|
|
38
|
-
if (match) {
|
|
39
|
-
return KEYWORD_OPTIONS[format];
|
|
40
|
-
}
|
|
41
|
-
return null; // custom pattern
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ─── Custom Pattern Formatting ────────────────────────────
|
|
45
|
-
|
|
46
|
-
function _formatCustom(date, pattern, locale) {
|
|
47
|
-
const day = date.getDate();
|
|
48
|
-
const month = date.getMonth();
|
|
49
|
-
const year = date.getFullYear();
|
|
50
|
-
const hours = date.getHours();
|
|
51
|
-
const minutes = date.getMinutes();
|
|
52
|
-
|
|
53
|
-
let mmmmVal, mmmVal;
|
|
54
|
-
const fallback = getLocaleFallback(locale);
|
|
55
|
-
const langPrefix = (locale || '').toLowerCase().split('-')[0];
|
|
56
|
-
const formatter = _getFormatter(locale, { month: 'long' });
|
|
57
|
-
const resolvedLocale = formatter.resolvedOptions().locale.toLowerCase().split('-')[0];
|
|
58
|
-
const isFallbackNeeded = fallback && resolvedLocale !== langPrefix;
|
|
59
|
-
|
|
60
|
-
if (isFallbackNeeded && fallback.monthsLong) {
|
|
61
|
-
mmmmVal = fallback.monthsLong[month];
|
|
62
|
-
} else {
|
|
63
|
-
mmmmVal = _getFormatter(locale, { month: 'long' }).format(date);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (isFallbackNeeded && fallback.monthsShort) {
|
|
67
|
-
mmmVal = fallback.monthsShort[month];
|
|
68
|
-
} else {
|
|
69
|
-
mmmVal = _getFormatter(locale, { month: 'short' }).format(date);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const tokens = {
|
|
73
|
-
'yyyy': String(year),
|
|
74
|
-
'yy': String(year).slice(-2),
|
|
75
|
-
'MMMM': mmmmVal,
|
|
76
|
-
'MMM': mmmVal,
|
|
77
|
-
'MM': String(month + 1).padStart(2, '0'),
|
|
78
|
-
'M': String(month + 1),
|
|
79
|
-
'dd': String(day).padStart(2, '0'),
|
|
80
|
-
'd': String(day),
|
|
81
|
-
'HH': String(hours).padStart(2, '0'),
|
|
82
|
-
'mm': String(minutes).padStart(2, '0')
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return pattern.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g, function (m) { return tokens[m]; });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// ─── Format Date ──────────────────────────────────────────
|
|
89
|
-
|
|
90
|
-
function _formatDate(date, format, locale) {
|
|
91
|
-
const intlOptions = _getIntlOptions(format);
|
|
92
|
-
if (intlOptions) {
|
|
93
|
-
const formatter = _getFormatter(locale, intlOptions);
|
|
94
|
-
const langPrefix = (locale || '').toLowerCase().split('-')[0];
|
|
95
|
-
const resolvedLocale = formatter.resolvedOptions().locale.toLowerCase().split('-')[0];
|
|
96
|
-
const fallback = getLocaleFallback(locale);
|
|
97
|
-
|
|
98
|
-
if (fallback && resolvedLocale !== langPrefix) {
|
|
99
|
-
return _formatCustom(date, 'dd.MM.yyyy', locale);
|
|
100
|
-
}
|
|
101
|
-
return formatter.format(date);
|
|
102
|
-
}
|
|
103
|
-
return _formatCustom(date, format, locale);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ─── Component Helpers ────────────────────────────────────
|
|
107
|
-
|
|
108
|
-
function _toISO(date) {
|
|
109
|
-
if (!date) return '';
|
|
110
|
-
const y = date.getFullYear();
|
|
111
|
-
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
112
|
-
const d = String(date.getDate()).padStart(2, '0');
|
|
113
|
-
return y + '-' + m + '-' + d;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function _notifyChange(self, iso, date) {
|
|
117
|
-
dispatch(self.dom, 'ln-date:change', {
|
|
118
|
-
value: iso,
|
|
119
|
-
formatted: self.dom.value,
|
|
120
|
-
date: date
|
|
121
|
-
});
|
|
122
|
-
self.dom.dispatchEvent(new Event('change', { bubbles: true }));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function _updateState(self, iso, date, formattedText) {
|
|
126
|
-
self._setHiddenRaw(iso);
|
|
127
|
-
_inputValueDesc.set.call(self._picker, iso);
|
|
128
|
-
self._lastISO = iso;
|
|
129
|
-
if (formattedText !== undefined) {
|
|
130
|
-
self._isFormatting = true;
|
|
131
|
-
self.dom.value = formattedText;
|
|
132
|
-
self._isFormatting = false;
|
|
133
|
-
} else if (date) {
|
|
134
|
-
self._displayFormatted(date);
|
|
135
|
-
}
|
|
136
|
-
_notifyChange(self, iso, date);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function _clearState(self) {
|
|
140
|
-
self._setHiddenRaw('');
|
|
141
|
-
_inputValueDesc.set.call(self._picker, '');
|
|
142
|
-
self._isFormatting = true;
|
|
143
|
-
self.dom.value = '';
|
|
144
|
-
self._isFormatting = false;
|
|
145
|
-
self._lastISO = '';
|
|
146
|
-
_notifyChange(self, '', null);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// ─── Component ────────────────────────────────────────────
|
|
150
|
-
|
|
151
|
-
// ─── Component ────────────────────────────────────────────
|
|
152
|
-
|
|
153
|
-
_component.prototype._initTextElement = function () {
|
|
154
|
-
const dom = this.dom;
|
|
155
|
-
let valAttr = dom.getAttribute('data-ln-value');
|
|
156
|
-
let dateAttr = dom.getAttribute('data-ln-date');
|
|
157
|
-
let datetimeAttr = dom.getAttribute('datetime');
|
|
158
|
-
|
|
159
|
-
let candidate = null;
|
|
160
|
-
if (valAttr !== null && valAttr !== '') {
|
|
161
|
-
candidate = valAttr;
|
|
162
|
-
} else if (datetimeAttr !== null && datetimeAttr !== '') {
|
|
163
|
-
candidate = datetimeAttr;
|
|
164
|
-
} else if (dateAttr !== null && dateAttr !== '' && dateAttr !== 'true' && !KEYWORD_RE.test(dateAttr)) {
|
|
165
|
-
candidate = dateAttr;
|
|
166
|
-
} else {
|
|
167
|
-
candidate = dom.textContent.trim();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
let date = _parseISO(candidate) || _parseTyped(candidate);
|
|
171
|
-
if (!date && candidate) {
|
|
172
|
-
if (!isNaN(candidate)) {
|
|
173
|
-
const num = Number(candidate);
|
|
174
|
-
date = new Date(num > 1e11 ? num : num * 1000);
|
|
175
|
-
} else {
|
|
176
|
-
date = new Date(candidate);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
if (date && !isNaN(date.getTime())) {
|
|
180
|
-
const iso = _toISO(date);
|
|
181
|
-
this._rawValue = iso;
|
|
182
|
-
if (!dom.hasAttribute('data-ln-value')) {
|
|
183
|
-
dom.setAttribute('data-ln-value', iso);
|
|
184
|
-
}
|
|
185
|
-
this._formatTextContent();
|
|
186
|
-
} else {
|
|
187
|
-
this._rawValue = null;
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
_component.prototype._formatTextContent = function () {
|
|
192
|
-
if (this._rawValue) {
|
|
193
|
-
const date = _parseISO(this._rawValue);
|
|
194
|
-
if (date) {
|
|
195
|
-
const formatAttr = this.dom.getAttribute('data-ln-date-format');
|
|
196
|
-
let format = formatAttr;
|
|
197
|
-
if (!format) {
|
|
198
|
-
const dateAttr = this.dom.getAttribute('data-ln-date');
|
|
199
|
-
if (dateAttr && KEYWORD_RE.test(dateAttr)) {
|
|
200
|
-
format = dateAttr;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
const locale = getLocale(this.dom);
|
|
204
|
-
this.dom.textContent = _formatDate(date, format || 'medium', locale);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
function _component(dom) {
|
|
210
|
-
if (dom[DOM_ATTRIBUTE]) return dom[DOM_ATTRIBUTE];
|
|
211
|
-
dom[DOM_ATTRIBUTE] = this;
|
|
212
|
-
|
|
213
|
-
this.dom = dom;
|
|
214
|
-
|
|
215
|
-
if (dom.tagName !== 'INPUT') {
|
|
216
|
-
this.isTextElement = true;
|
|
217
|
-
this._initTextElement();
|
|
218
|
-
return this;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
this.isTextElement = false;
|
|
222
|
-
const self = this;
|
|
223
|
-
|
|
224
|
-
// ── Read initial state ──────────────────────────────
|
|
225
|
-
const initialValue = dom.value;
|
|
226
|
-
const name = dom.name;
|
|
227
|
-
|
|
228
|
-
// Check for declarative HTML dictionary nearby
|
|
229
|
-
const container = dom.closest('.form-element, form') || dom.parentNode;
|
|
230
|
-
const dictEls = container.querySelectorAll('[data-ln-date-dict]');
|
|
231
|
-
for (let i = 0; i < dictEls.length; i++) {
|
|
232
|
-
const lang = dictEls[i].getAttribute('data-ln-date-dict');
|
|
233
|
-
if (lang) {
|
|
234
|
-
const dictData = buildDict(dictEls[i], 'data-ln-date-dict-key');
|
|
235
|
-
if (dictData['months-long']) {
|
|
236
|
-
dictData.monthsLong = dictData['months-long'].split(',').map(s => s.trim());
|
|
237
|
-
}
|
|
238
|
-
if (dictData['months-short']) {
|
|
239
|
-
dictData.monthsShort = dictData['months-short'].split(',').map(s => s.trim());
|
|
240
|
-
}
|
|
241
|
-
registerLocaleFallback(lang, dictData);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// ── Wrap field: replace dom with <span data-ln-date-field> and move dom inside ──
|
|
246
|
-
const wrapper = document.createElement('span');
|
|
247
|
-
wrapper.setAttribute('data-ln-date-field', '');
|
|
248
|
-
dom.parentNode.insertBefore(wrapper, dom);
|
|
249
|
-
wrapper.appendChild(dom);
|
|
250
|
-
this._wrapper = wrapper;
|
|
251
|
-
|
|
252
|
-
// ── Create hidden input for form submission ─────────
|
|
253
|
-
const hidden = document.createElement('input');
|
|
254
|
-
hidden.type = 'hidden';
|
|
255
|
-
hidden.name = name;
|
|
256
|
-
dom.removeAttribute('name');
|
|
257
|
-
if (dom.hasAttribute('data-ln-fill-as')) {
|
|
258
|
-
hidden.setAttribute('data-ln-fill-as', dom.getAttribute('data-ln-fill-as'));
|
|
259
|
-
}
|
|
260
|
-
dom.insertAdjacentElement('afterend', hidden);
|
|
261
|
-
this._hidden = hidden;
|
|
262
|
-
|
|
263
|
-
// ── Create hidden date input for native picker ──────
|
|
264
|
-
const picker = document.createElement('input');
|
|
265
|
-
picker.type = 'date';
|
|
266
|
-
picker.tabIndex = -1;
|
|
267
|
-
picker.style.cssText = 'position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none';
|
|
268
|
-
hidden.insertAdjacentElement('afterend', picker);
|
|
269
|
-
this._picker = picker;
|
|
270
|
-
|
|
271
|
-
// ── Transform original input to text display ────────
|
|
272
|
-
dom.type = 'text';
|
|
273
|
-
|
|
274
|
-
// ── Create calendar button ──────────────────────────
|
|
275
|
-
const btn = document.createElement('button');
|
|
276
|
-
btn.type = 'button';
|
|
277
|
-
btn.setAttribute('aria-label', dom.getAttribute('data-ln-date-label') || 'Open date picker');
|
|
278
|
-
btn.innerHTML = '<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>';
|
|
279
|
-
picker.insertAdjacentElement('afterend', btn);
|
|
280
|
-
this._btn = btn;
|
|
281
|
-
this._lastISO = '';
|
|
282
|
-
|
|
283
|
-
// ── Intercept programmatic value sets on hidden input ──
|
|
284
|
-
Object.defineProperty(hidden, 'value', {
|
|
285
|
-
get: function () {
|
|
286
|
-
return _inputValueDesc.get.call(hidden);
|
|
287
|
-
},
|
|
288
|
-
set: function (val) {
|
|
289
|
-
_inputValueDesc.set.call(hidden, val);
|
|
290
|
-
if (val && val !== '') {
|
|
291
|
-
const date = _parseISO(val);
|
|
292
|
-
if (date) _updateState(self, val, date);
|
|
293
|
-
} else if (val === '') {
|
|
294
|
-
_clearState(self);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
// ── Intercept programmatic value sets on visible input (2-way binding) ──
|
|
300
|
-
interceptValueProperty(dom, _inputValueDesc, {
|
|
301
|
-
get: function () {
|
|
302
|
-
return _inputValueDesc.get.call(dom);
|
|
303
|
-
},
|
|
304
|
-
set: function (val, originalSet) {
|
|
305
|
-
if (self._isFormatting) {
|
|
306
|
-
originalSet(val);
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
if (!val || val === '') {
|
|
310
|
-
originalSet('');
|
|
311
|
-
_clearState(self);
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
const date = _parseISO(val) || _parseTyped(val);
|
|
316
|
-
|
|
317
|
-
if (date) {
|
|
318
|
-
const iso = _toISO(date);
|
|
319
|
-
const format = dom.getAttribute(DOM_SELECTOR) || '';
|
|
320
|
-
const locale = getLocale(dom);
|
|
321
|
-
const formatted = _formatDate(date, format, locale);
|
|
322
|
-
originalSet(formatted);
|
|
323
|
-
_updateState(self, iso, date, formatted);
|
|
324
|
-
} else {
|
|
325
|
-
originalSet(String(val));
|
|
326
|
-
_clearState(self);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
// ── Bind events ─────────────────────────────────────
|
|
332
|
-
this._onPickerChange = function () {
|
|
333
|
-
const val = picker.value;
|
|
334
|
-
if (val) {
|
|
335
|
-
const date = _parseISO(val);
|
|
336
|
-
if (date) _updateState(self, val, date);
|
|
337
|
-
} else {
|
|
338
|
-
_clearState(self);
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
picker.addEventListener('change', this._onPickerChange);
|
|
342
|
-
|
|
343
|
-
this._onBlur = function () {
|
|
344
|
-
const typed = self.dom.value.trim();
|
|
345
|
-
|
|
346
|
-
if (typed === '') {
|
|
347
|
-
if (self._lastISO !== '') _clearState(self);
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (self._lastISO) {
|
|
352
|
-
const currentDate = _parseISO(self._lastISO);
|
|
353
|
-
if (currentDate) {
|
|
354
|
-
const format = self.dom.getAttribute(DOM_SELECTOR) || '';
|
|
355
|
-
const locale = getLocale(self.dom);
|
|
356
|
-
if (typed === _formatDate(currentDate, format, locale)) return;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
const parsed = _parseTyped(typed);
|
|
361
|
-
if (parsed) {
|
|
362
|
-
const iso = _toISO(parsed);
|
|
363
|
-
_updateState(self, iso, parsed);
|
|
364
|
-
} else {
|
|
365
|
-
if (self._lastISO) {
|
|
366
|
-
const prevDate = _parseISO(self._lastISO);
|
|
367
|
-
if (prevDate) self._displayFormatted(prevDate);
|
|
368
|
-
} else {
|
|
369
|
-
self.dom.value = '';
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
dom.addEventListener('blur', this._onBlur);
|
|
374
|
-
|
|
375
|
-
this._onBtnClick = function () {
|
|
376
|
-
self._openPicker();
|
|
377
|
-
};
|
|
378
|
-
btn.addEventListener('click', this._onBtnClick);
|
|
379
|
-
|
|
380
|
-
// ── Handle pre-filled value ─────────────────────────
|
|
381
|
-
if (initialValue && initialValue !== '') {
|
|
382
|
-
const date = _parseISO(initialValue);
|
|
383
|
-
if (date) _updateState(self, initialValue, date);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
return this;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// ─── Parsing Helpers ──────────────────────────────────────
|
|
390
|
-
|
|
391
|
-
function _parseISO(str) {
|
|
392
|
-
if (!str || typeof str !== 'string') return null;
|
|
393
|
-
const parts = str.split('T');
|
|
394
|
-
const dateParts = parts[0].split('-');
|
|
395
|
-
if (dateParts.length < 3) return null;
|
|
396
|
-
const y = parseInt(dateParts[0], 10);
|
|
397
|
-
const m = parseInt(dateParts[1], 10) - 1;
|
|
398
|
-
const d = parseInt(dateParts[2], 10);
|
|
399
|
-
if (isNaN(y) || isNaN(m) || isNaN(d)) return null;
|
|
400
|
-
let h = 0, min = 0;
|
|
401
|
-
if (parts[1]) {
|
|
402
|
-
const timeParts = parts[1].split(':');
|
|
403
|
-
h = parseInt(timeParts[0], 10) || 0;
|
|
404
|
-
min = parseInt(timeParts[1], 10) || 0;
|
|
405
|
-
}
|
|
406
|
-
const date = new Date(y, m, d, h, min);
|
|
407
|
-
if (date.getFullYear() !== y || date.getMonth() !== m || date.getDate() !== d) return null;
|
|
408
|
-
return date;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function _parseTyped(str) {
|
|
412
|
-
if (!str || typeof str !== 'string') return null;
|
|
413
|
-
str = str.trim();
|
|
414
|
-
if (str.length < 6) return null;
|
|
415
|
-
|
|
416
|
-
let sep, parts;
|
|
417
|
-
if (str.indexOf('.') !== -1) {
|
|
418
|
-
sep = '.'; parts = str.split('.');
|
|
419
|
-
} else if (str.indexOf('/') !== -1) {
|
|
420
|
-
sep = '/'; parts = str.split('/');
|
|
421
|
-
} else if (str.indexOf('-') !== -1) {
|
|
422
|
-
sep = '-'; parts = str.split('-');
|
|
423
|
-
} else {
|
|
424
|
-
return null;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
if (parts.length !== 3) return null;
|
|
428
|
-
const nums = [];
|
|
429
|
-
for (let i = 0; i < 3; i++) {
|
|
430
|
-
const n = parseInt(parts[i], 10);
|
|
431
|
-
if (isNaN(n)) return null;
|
|
432
|
-
nums.push(n);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
let day, month, year;
|
|
436
|
-
if (sep === '.') {
|
|
437
|
-
day = nums[0]; month = nums[1]; year = nums[2];
|
|
438
|
-
} else if (sep === '/') {
|
|
439
|
-
month = nums[0]; day = nums[1]; year = nums[2];
|
|
440
|
-
} else {
|
|
441
|
-
if (parts[0].length === 4) {
|
|
442
|
-
year = nums[0]; month = nums[1]; day = nums[2];
|
|
443
|
-
} else {
|
|
444
|
-
day = nums[0]; month = nums[1]; year = nums[2];
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
if (year < 100) {
|
|
449
|
-
year += (year < 50) ? 2000 : 1900;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
const date = new Date(year, month - 1, day);
|
|
453
|
-
if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
|
|
454
|
-
return null;
|
|
455
|
-
}
|
|
456
|
-
return date;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
_component.prototype._openPicker = function () {
|
|
460
|
-
if (typeof this._picker.showPicker === 'function') {
|
|
461
|
-
try {
|
|
462
|
-
this._picker.showPicker();
|
|
463
|
-
} catch (e) {
|
|
464
|
-
this._picker.click();
|
|
465
|
-
}
|
|
466
|
-
} else {
|
|
467
|
-
this._picker.click();
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
_component.prototype._setHiddenRaw = function (val) {
|
|
472
|
-
_inputValueDesc.set.call(this._hidden, val);
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
_component.prototype._displayFormatted = function (date) {
|
|
476
|
-
const format = this.dom.getAttribute(DOM_SELECTOR) || '';
|
|
477
|
-
const locale = getLocale(this.dom);
|
|
478
|
-
this._isFormatting = true;
|
|
479
|
-
this.dom.value = _formatDate(date, format, locale);
|
|
480
|
-
this._isFormatting = false;
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
// ─── Public API ───────────────────────────────────────────
|
|
484
|
-
|
|
485
|
-
Object.defineProperty(_component.prototype, 'value', {
|
|
486
|
-
get: function () {
|
|
487
|
-
if (this.isTextElement) {
|
|
488
|
-
return this._rawValue || '';
|
|
489
|
-
}
|
|
490
|
-
return _inputValueDesc.get.call(this._hidden);
|
|
491
|
-
},
|
|
492
|
-
set: function (isoStr) {
|
|
493
|
-
if (this.isTextElement) {
|
|
494
|
-
if (!isoStr || isoStr === '') {
|
|
495
|
-
this._rawValue = null;
|
|
496
|
-
this.dom.removeAttribute('data-ln-value');
|
|
497
|
-
this.dom.textContent = '';
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
const date = _parseISO(isoStr) || _parseTyped(isoStr);
|
|
501
|
-
if (!date) return;
|
|
502
|
-
const iso = _toISO(date);
|
|
503
|
-
this._rawValue = iso;
|
|
504
|
-
this.dom.setAttribute('data-ln-value', iso);
|
|
505
|
-
this._formatTextContent();
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
if (!isoStr || isoStr === '') {
|
|
509
|
-
_clearState(this);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
const date = _parseISO(isoStr);
|
|
513
|
-
if (!date) return;
|
|
514
|
-
_updateState(this, isoStr, date);
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
|
|
518
|
-
Object.defineProperty(_component.prototype, 'date', {
|
|
519
|
-
get: function () {
|
|
520
|
-
const val = this.value;
|
|
521
|
-
if (!val) return null;
|
|
522
|
-
return _parseISO(val);
|
|
523
|
-
},
|
|
524
|
-
set: function (dateObj) {
|
|
525
|
-
if (!dateObj || !(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
|
|
526
|
-
this.value = '';
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
this.value = _toISO(dateObj);
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
|
-
|
|
533
|
-
Object.defineProperty(_component.prototype, 'formatted', {
|
|
534
|
-
get: function () {
|
|
535
|
-
if (this.isTextElement) {
|
|
536
|
-
return this.dom.textContent;
|
|
537
|
-
}
|
|
538
|
-
return this.dom.value;
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
|
|
542
|
-
_component.prototype.destroy = function () {
|
|
543
|
-
if (!this.dom[DOM_ATTRIBUTE]) return;
|
|
544
|
-
if (this.isTextElement) {
|
|
545
|
-
dispatch(this.dom, 'ln-date:destroyed', { target: this.dom });
|
|
546
|
-
delete this.dom[DOM_ATTRIBUTE];
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
this._picker.removeEventListener('change', this._onPickerChange);
|
|
550
|
-
this.dom.removeEventListener('blur', this._onBlur);
|
|
551
|
-
this._btn.removeEventListener('click', this._onBtnClick);
|
|
552
|
-
const isoVal = this.value;
|
|
553
|
-
this._hidden.remove();
|
|
554
|
-
this._picker.remove();
|
|
555
|
-
this._btn.remove();
|
|
556
|
-
if (this._wrapper && this._wrapper.parentNode) {
|
|
557
|
-
this._wrapper.parentNode.insertBefore(this.dom, this._wrapper);
|
|
558
|
-
this._wrapper.remove();
|
|
559
|
-
}
|
|
560
|
-
delete this.dom.value;
|
|
561
|
-
this.dom.name = this._hidden.name;
|
|
562
|
-
this.dom.type = 'date';
|
|
563
|
-
if (isoVal) this.dom.value = isoVal;
|
|
564
|
-
dispatch(this.dom, 'ln-date:destroyed', { target: this.dom });
|
|
565
|
-
delete this.dom[DOM_ATTRIBUTE];
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
// ─── Locale Observer ──────────────────────────────────────
|
|
569
|
-
|
|
570
|
-
function _localeObserver() {
|
|
571
|
-
new MutationObserver(function () {
|
|
572
|
-
const els = document.querySelectorAll('[' + DOM_SELECTOR + ']');
|
|
573
|
-
for (let i = 0; i < els.length; i++) {
|
|
574
|
-
const inst = els[i][DOM_ATTRIBUTE];
|
|
575
|
-
if (inst) {
|
|
576
|
-
if (inst.isTextElement) {
|
|
577
|
-
inst._formatTextContent();
|
|
578
|
-
} else if (inst.value) {
|
|
579
|
-
const date = _parseISO(inst.value);
|
|
580
|
-
if (date) inst._displayFormatted(date);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}).observe(document.documentElement, { attributes: true, attributeFilter: ['lang'], subtree: true });
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
// ─── Init ─────────────────────────────────────────────────
|
|
588
|
-
|
|
589
|
-
registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-date', {
|
|
590
|
-
extraAttributes: ['data-ln-date-format', 'data-ln-date-locale', 'data-ln-value', 'datetime', 'lang'],
|
|
591
|
-
onAttributeChange: function (el) {
|
|
592
|
-
const inst = el[DOM_ATTRIBUTE];
|
|
593
|
-
if (!inst) return;
|
|
594
|
-
if (inst.isTextElement) {
|
|
595
|
-
inst._initTextElement();
|
|
596
|
-
} else if (inst.value) {
|
|
597
|
-
const date = _parseISO(inst.value);
|
|
598
|
-
if (date) inst._displayFormatted(date);
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
});
|
|
602
|
-
_localeObserver();
|
|
603
|
-
})();
|
package/js/ln-debug/README.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# ln-debug
|
|
2
|
-
|
|
3
|
-
> The diagnostic component of `ln-ashlar` that enables verbose developer warnings in console logs during development.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. Philosophy
|
|
8
|
-
|
|
9
|
-
In production, libraries should remain silent and not pollute the browser console with developer-oriented warnings (such as template mismatch warnings or missing configuration parameters).
|
|
10
|
-
|
|
11
|
-
The `ln-debug` component solves this by acting as a global switch:
|
|
12
|
-
- When active, all core validation warnings (prefixed with `[ln-` or `[lnCore`) are enabled.
|
|
13
|
-
- When inactive, these developer warnings are safely suppressed, maintaining a clean production log.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## 2. Minimal Blueprint
|
|
18
|
-
|
|
19
|
-
Add the `data-ln-debug` attribute to either the `<html>` or `<body>` element (or any element in the document) to enable debug logs:
|
|
20
|
-
|
|
21
|
-
```html
|
|
22
|
-
<!DOCTYPE html>
|
|
23
|
-
<html lang="en" data-ln-debug>
|
|
24
|
-
<head>
|
|
25
|
-
<script src="dist/ln-ashlar.iife.js" defer></script>
|
|
26
|
-
</head>
|
|
27
|
-
<body>
|
|
28
|
-
<!-- Warnings will be visible in the developer console -->
|
|
29
|
-
</body>
|
|
30
|
-
</html>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 3. DOM & State Management
|
|
36
|
-
|
|
37
|
-
This component lives entirely at the level of the DOM. The single source of truth is the presence of the `data-ln-debug` attribute on `<html>` or `<body>`.
|
|
38
|
-
|
|
39
|
-
### Checking the State via JS
|
|
40
|
-
|
|
41
|
-
To check if debug mode is active in your scripts, query the DOM directly:
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
const isDebug = document.documentElement.hasAttribute('data-ln-debug') ||
|
|
45
|
-
(document.body && document.body.hasAttribute('data-ln-debug'));
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Toggling the State
|
|
49
|
-
|
|
50
|
-
To toggle debug mode at runtime, add or remove the attribute from the DOM:
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
// Enable
|
|
54
|
-
document.documentElement.setAttribute('data-ln-debug', '');
|
|
55
|
-
|
|
56
|
-
// Disable
|
|
57
|
-
document.documentElement.removeAttribute('data-ln-debug');
|
|
58
|
-
```
|
package/js/ln-debug/ln-debug.js
DELETED
|
@@ -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 m={};function _(t,e){m[t]||(m[t]=document.querySelector('[data-ln-template="'+t+'"]'));const n=m[t];return n?n.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function x(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 s=0;s<l.length;s++){const d=l[s].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),a=d[1].trim();e[a]!=null&&i.setAttribute(f,e[a])}}const u=t.querySelectorAll("[data-ln-show]");for(let o=0;o<u.length;o++){const i=u[o],l=i.getAttribute("data-ln-show");l in e&&i.classList.toggle("hidden",!e[l])}const r=t.querySelectorAll("[data-ln-class]");for(let o=0;o<r.length;o++){const i=r[o],l=i.getAttribute("data-ln-class").split(",");for(let s=0;s<l.length;s++){const d=l[s].trim().split(":");if(d.length!==2)continue;const f=d[0].trim(),a=d[1].trim();a in e&&i.classList.toggle(f,!!e[a])}}return t}function q(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)x(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 L(t,e){if(!t||!e)return t;const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const r=n.currentNode;r.textContent.indexOf("{{")!==-1&&(r.textContent=r.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,i){return e[i]!==void 0?e[i]:""}))}const c=function(r,o){return e[o]!==void 0?e[o]:""},u=Array.from(t.querySelectorAll("*"));t.nodeType===1&&u.push(t);for(let r=0;r<u.length;r++){const o=u[r],i=o.attributes;for(let l=0;l<i.length;l++){const s=i[l];s.value.indexOf("{{")!==-1&&o.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,c))}}return t}function M(t,e,n,c,u,r){const o={};for(let l=0;l<t.children.length;l++){const s=t.children[l],d=s.getAttribute("data-ln-key");d&&(o[d]=s)}const i=document.createDocumentFragment();for(let l=0;l<e.length;l++){const s=e[l],d=String(c(s));let f=o[d];if(f)u(f,s,l);else{const a=_(n,r);if(!a||(L(a,s),f=a.firstElementChild,!f))continue;f.setAttribute("data-ln-key",d),u(f,s,l)}i.appendChild(f)}t.textContent="",t.appendChild(i)}function S(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function g(t,e,n,c){if(t.nodeType!==1)return;const r=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",o=Array.from(t.querySelectorAll(r));t.matches&&t.matches(r)&&o.push(t);for(const i of o)i[n]||(i[n]=new c(i))}function N(t,e,n,c,u={}){const r=u.extraAttributes||[],o=u.onAttributeChange||null,i=u.onInit||null;function l(s){const d=s||document.body;g(d,t,e,n),i&&i(d)}return S(function(){const s=new MutationObserver(function(f){for(let a=0;a<f.length;a++){const h=f[a];if(h.type==="childList"){for(let w=0;w<h.addedNodes.length;w++){const p=h.addedNodes[w];p.nodeType===1&&(g(p,t,e,n),i&&i(p))}for(let w=0;w<h.removedNodes.length;w++){const p=h.removedNodes[w];if(p.nodeType===1){const E=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",b=Array.from(p.querySelectorAll(E));p.matches&&p.matches(E)&&b.push(p);for(let C=0;C<b.length;C++){const D=b[C];if(!document.contains(D)){const A=D[e];A&&typeof A.destroy=="function"&&A.destroy()}}}}}else h.type==="attributes"&&(o&&h.target[e]?o(h.target,h.attributeName):(g(h.target,t,e,n),i&&i(h.target)))}});let d=[];if(t.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let a;for(;(a=f.exec(t))!==null;)d.push(a[1])}else d.push(t);s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:d.concat(r)})},c),window[e]=l,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){l(document.body)}):l(document.body),l}const O={};function j(t,e){O[t]=e}function W(t){return O[t]||{ingress:e=>e,egress:e=>e}}const k={};function v(t,e){if(!t||typeof e!="object")return;const n=t.toLowerCase().split("-")[0];k[n]=e}function F(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return k[e]||null}v("mk",{monthsLong:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],monthsShort:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],daysLong:["недела","понеделник","вторник","среда","четврток","петок","сабота"],daysShort:["нед","пон","вт","ср","чет","пет","саб"]}),typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W,window.lnCore.registerLocaleFallback=v,window.lnCore.getLocaleFallback=F,window.lnCore.fillTemplate=L,window.lnCore.fill=x,window.lnCore.lnFill=q,window.lnCore.renderList=M);function T(t){return(t||"").replace(/^#/,"")}function y(t){const e=t===void 0?location.hash:t,n={},c=T(e);if(!c)return n;const u=c.split("&");for(let r=0;r<u.length;r++){const o=u[r];if(!o)continue;const i=o.indexOf(":"),l=i>-1?o.slice(0,i):o,s=i>-1?o.slice(i+1):"";if(l)try{n[l]=decodeURIComponent(s)}catch{n[l]=s}}return n}function B(t){if(!t)return null;const e=y();return t in e?e[t]:null}function I(t,e){if(!t)return;const n=y();e==null?delete n[t]:n[t]=String(e);const u=Object.keys(n).map(function(r){const o=n[r];return o===""?r:r+":"+encodeURIComponent(o)}).join("&");T(location.hash)!==u&&(location.hash=u)}function K(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=y,window.lnCore.hashGet=B,window.lnCore.hashSet=I,window.lnCore.hashLinkClick=K),(function(){const t="data-ln-debug",e="lnDebug";if(window[e]!==void 0)return;function n(c){return this.dom=c,this}n.prototype.destroy=function(){delete this.dom[e]},N(t,e,n,"ln-debug")})()})();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { registerComponent } from '../../ln-core';
|
|
2
|
-
|
|
3
|
-
(function () {
|
|
4
|
-
const DOM_SELECTOR = 'data-ln-debug';
|
|
5
|
-
const DOM_ATTRIBUTE = 'lnDebug';
|
|
6
|
-
|
|
7
|
-
if (window[DOM_ATTRIBUTE] !== undefined) return;
|
|
8
|
-
|
|
9
|
-
function _component(dom) {
|
|
10
|
-
this.dom = dom;
|
|
11
|
-
return this;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
_component.prototype.destroy = function () {
|
|
15
|
-
delete this.dom[DOM_ATTRIBUTE];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-debug');
|
|
19
|
-
})();
|