@farris/ui-vue 1.7.3 → 1.7.5
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/components/accordion/index.esm.js +312 -61
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +1482 -56
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +752 -8
- package/components/binding-selector/index.umd.cjs +1 -1
- package/components/button-group/index.esm.js +266 -110
- package/components/button-group/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +129 -128
- package/components/calendar/index.umd.cjs +2 -2
- package/components/code-editor/index.esm.js +237 -169
- package/components/code-editor/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +134 -133
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/color-picker/index.esm.js +812 -502
- package/components/color-picker/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +323 -291
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +355 -174
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +134 -133
- package/components/comment/index.umd.cjs +2 -2
- package/components/common/index.esm.js +1 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +3791 -2760
- package/components/component/index.umd.cjs +8 -1
- package/components/condition/index.esm.js +2482 -492
- package/components/condition/index.umd.cjs +8 -1
- package/components/data-view/index.esm.js +1816 -1790
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1 -1
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +2975 -2615
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +397 -387
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dropdown/index.esm.js +373 -124
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +592 -1894
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +250 -248
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +427 -466
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +1 -1
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1890 -1473
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.css +1 -1
- package/components/expression-editor/index.esm.js +7371 -2
- package/components/expression-editor/index.umd.cjs +427 -1
- package/components/fieldset/index.esm.js +1 -1
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +2 -3
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.css +1 -1
- package/components/filter-condition-editor/index.esm.js +9044 -425
- package/components/filter-condition-editor/index.umd.cjs +427 -1
- package/components/html-template/index.esm.js +33 -36
- package/components/html-template/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +615 -361
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/json-editor/index.esm.js +325 -247
- package/components/json-editor/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +269 -269
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/layout/index.esm.js +549 -163
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +837 -39
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +427 -646
- package/components/list-view/index.umd.cjs +6 -6
- package/components/lookup/index.esm.js +3624 -3625
- package/components/lookup/index.umd.cjs +1 -1
- package/components/menu-lookup/index.esm.js +577 -536
- package/components/menu-lookup/index.umd.cjs +6 -6
- package/components/nav/index.esm.js +311 -31
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +1634 -189
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +82 -82
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1190 -850
- package/components/order/index.umd.cjs +6 -6
- package/components/page-footer/index.esm.js +331 -48
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +110 -116
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +509 -232
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +353 -148
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +157 -153
- package/components/property-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +1825 -871
- package/components/property-panel/index.umd.cjs +12 -5
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +6075 -3863
- package/components/query-solution/index.umd.cjs +13 -6
- package/components/response-layout/index.esm.js +1 -1
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +2447 -2221
- package/components/schema-selector/index.umd.cjs +7 -7
- package/components/search-box/index.esm.js +244 -72
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +134 -133
- package/components/section/index.umd.cjs +2 -2
- package/components/smoke-detector/index.esm.js +179 -8
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.css +1 -0
- package/components/sort-condition-editor/index.esm.js +9488 -4
- package/components/sort-condition-editor/index.umd.cjs +427 -1
- package/components/splitter/index.esm.js +1172 -142
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +47 -48
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +490 -419
- package/components/tabs/index.umd.cjs +1 -1
- package/components/text/index.esm.js +217 -73
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +29 -27
- package/components/textarea/index.umd.cjs +2 -2
- package/components/transfer/index.esm.js +760 -543
- package/components/transfer/index.umd.cjs +5 -5
- package/components/tree-grid/index.esm.js +105 -104
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +320 -153
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +1125 -634
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +359 -106
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +222 -89
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +290 -199
- package/components/weather/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +5192 -4408
- package/designer/data-grid/index.umd.cjs +17 -10
- package/designer/drawer/index.esm.js +576 -567
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +1418 -1154
- package/designer/dynamic-form/index.umd.cjs +8 -1
- package/designer/farris-designer.all.esm.js +12665 -12117
- package/designer/farris-designer.all.umd.cjs +12 -12
- package/designer/list-view/index.esm.js +327 -327
- package/designer/list-view/index.umd.cjs +3 -3
- package/designer/modal/index.esm.js +29 -137
- package/designer/modal/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +0 -1
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-toolbar/index.esm.js +9 -9
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +1 -6
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +2829 -2540
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +822 -464
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +68724 -67244
- package/farris.all.umd.cjs +92 -92
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/accordion/src/accordion.props.d.ts +1 -0
- package/types/accordion/src/components/accordion-item.props.d.ts +1 -0
- package/types/avatar/src/avatar.props.d.ts +1 -0
- package/types/binding-selector/index.d.ts +54 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +1 -0
- package/types/button-group/index.d.ts +0 -15
- package/types/button-group/src/button-group.props.d.ts +1 -0
- package/types/code-editor/index.d.ts +1 -0
- package/types/code-editor/src/code-textbox.component.d.ts +6 -6
- package/types/code-editor/src/code-textbox.props.d.ts +2 -0
- package/types/color-picker/index.d.ts +15 -0
- package/types/color-picker/src/color-picker.props.d.ts +1 -0
- package/types/combo-list/src/composition/use-data-source.d.ts +2 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +14 -2
- package/types/combo-tree/src/combo-tree.props.d.ts +1 -0
- package/types/component/index.d.ts +2 -0
- package/types/component/src/component.props.d.ts +8 -0
- package/types/components.d.ts +6 -1
- package/types/condition/index.d.ts +55 -0
- package/types/designer-toolbox/index.d.ts +3 -0
- package/types/designer-toolbox/src/toolbox.component.d.ts +14 -0
- package/types/designer-toolbox/src/toolbox.props.d.ts +29 -0
- package/types/designer-toolbox/src/types.d.ts +21 -0
- package/types/designer.d.ts +13 -0
- package/types/dropdown/index.d.ts +6 -27
- package/types/dropdown/src/dropdown.item.component.d.ts +1 -1
- package/types/dropdown/src/dropdown.props.d.ts +1 -0
- package/types/dynamic-form/designer.d.ts +1 -3
- package/types/dynamic-form/index.d.ts +3 -9
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -3
- package/types/dynamic-resolver/index.d.ts +0 -3
- package/types/dynamic-resolver/src/resolver/property-config/property-config-resolver-design.d.ts +1 -1
- package/types/dynamic-resolver/src/resolver/property-config/property-config-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/resolver/property-config/use-property-config-resolver.d.ts +2 -2
- package/types/dynamic-resolver/src/resolver/schema/schema-resolver-design.d.ts +1 -1
- package/types/dynamic-resolver/src/resolver/schema/schema-resolver.d.ts +1 -1
- package/types/dynamic-view/src/components/maps.d.ts +104 -92
- package/types/{binding-selector/designer.d.ts → expression-editor/index.d.ts} +6 -6
- package/types/filter-condition-editor/index.d.ts +9 -0
- package/types/filter-condition-editor/src/components/filter-condition-grid.component.d.ts +12 -12
- package/types/filter-condition-editor/src/components/sort-editor-grid.component.d.ts +12 -12
- package/types/filter-condition-editor/src/filter-condition-editor.props.d.ts +1 -0
- package/types/flow-canvas/index.d.ts +3 -0
- package/types/{dynamic-form/src/component/form-control/form-control.component.d.ts → flow-canvas/src/components/flow-node-item.component.d.ts} +1 -1
- package/types/flow-canvas/src/components/flow-node-item.props.d.ts +3 -0
- package/types/flow-canvas/src/composition/types.d.ts +42 -0
- package/types/flow-canvas/src/composition/use-bezier-curve.d.ts +2 -0
- package/types/flow-canvas/src/composition/use-connections.d.ts +2 -0
- package/types/flow-canvas/src/composition/use-curve.d.ts +4 -0
- package/types/flow-canvas/src/composition/use-drawing-bezier.d.ts +2 -0
- package/types/flow-canvas/src/composition/use-drawing.d.ts +4 -0
- package/types/flow-canvas/src/flow-canvas.component.d.ts +8 -0
- package/types/flow-canvas/src/flow-canvas.props.d.ts +3 -0
- package/types/image-cropper/src/image-cropper.props.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/json-editor/src/json-editor.props.d.ts +1 -0
- package/types/layout/index.d.ts +0 -1
- package/types/layout/src/components/layout-pane.props.d.ts +1 -0
- package/types/layout/src/layout.props.d.ts +1 -0
- package/types/list-nav/index.d.ts +5 -24
- package/types/list-nav/src/list-nav.props.d.ts +1 -0
- package/types/list-view/index.d.ts +0 -1
- package/types/list-view/src/composition/use-draggable.d.ts +1 -1
- package/types/lookup/index.d.ts +1 -1
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/menu-lookup/src/menu-lookup.props.d.ts +1 -0
- package/types/modal/designer.d.ts +0 -2
- package/types/nav/index.d.ts +20 -24
- package/types/nav/src/nav.props.d.ts +1 -0
- package/types/number-range/src/number-range.props.d.ts +1 -0
- package/types/order/index.d.ts +5 -36
- package/types/order/src/designer/order.design.component.d.ts +1 -1
- package/types/order/src/order.props.d.ts +1 -0
- package/types/page-footer/index.d.ts +2 -0
- package/types/page-footer/src/page-footer.props.d.ts +1 -0
- package/types/pagination/index.d.ts +0 -15
- package/types/pagination/src/pagination.props.d.ts +1 -0
- package/types/progress/src/progress.props.d.ts +1 -0
- package/types/query-solution/index.d.ts +1 -1
- package/types/radio-group/designer.d.ts +1 -2
- package/types/search-box/index.d.ts +17 -1
- package/types/search-box/src/search-box.props.d.ts +1 -0
- package/types/section/designer.d.ts +0 -1
- package/types/smoke-detector/index.d.ts +2 -0
- package/types/smoke-detector/src/smoke-detector.props.d.ts +1 -0
- package/types/sort-condition-editor/index.d.ts +7 -2
- package/types/sort-condition-editor/src/sort-condition-editor.props.d.ts +1 -0
- package/types/splitter/index.d.ts +0 -1
- package/types/splitter/src/components/splitter-pane.props.d.ts +1 -0
- package/types/splitter/src/splitter.props.d.ts +1 -0
- package/types/tabs/designer.d.ts +0 -1
- package/types/tabs/index.d.ts +1 -0
- package/types/text/index.d.ts +20 -24
- package/types/text/src/text.props.d.ts +1 -0
- package/types/transfer/src/transfer.props.d.ts +1 -0
- package/types/tree-view/src/tree-view.props.d.ts +1 -0
- package/types/uploader/src/uploader.props.d.ts +1 -0
- package/types/verify-detail/index.d.ts +5 -58
- package/types/verify-detail/src/designer/verify-detail.design.component.d.ts +8 -8
- package/types/verify-detail/src/verify-detail.props.d.ts +1 -0
- package/types/video/index.d.ts +20 -24
- package/types/video/src/video.props.d.ts +1 -0
- package/components/dynamic-form/index.css +0 -1
- package/designer/accordion/index.esm.js +0 -257
- package/designer/accordion/index.umd.cjs +0 -1
- package/designer/avatar/index.esm.js +0 -1460
- package/designer/avatar/index.umd.cjs +0 -1
- package/designer/binding-selector/index.esm.js +0 -792
- package/designer/binding-selector/index.umd.cjs +0 -1
- package/designer/button-group/index.esm.js +0 -282
- package/designer/button-group/index.umd.cjs +0 -1
- package/designer/code-editor/index.esm.js +0 -75
- package/designer/code-editor/index.umd.cjs +0 -1
- package/designer/color-picker/index.esm.js +0 -1096
- package/designer/color-picker/index.umd.cjs +0 -1
- package/designer/combo-list/index.esm.js +0 -1095
- package/designer/combo-list/index.umd.cjs +0 -1
- package/designer/combo-tree/index.esm.js +0 -186
- package/designer/combo-tree/index.umd.cjs +0 -1
- package/designer/component/index.css +0 -1
- package/designer/component/index.esm.js +0 -5002
- package/designer/component/index.umd.cjs +0 -1
- package/designer/condition/index.esm.js +0 -1899
- package/designer/condition/index.umd.cjs +0 -1
- package/designer/dropdown/index.esm.js +0 -261
- package/designer/dropdown/index.umd.cjs +0 -1
- package/designer/expression-editor/index.css +0 -1
- package/designer/expression-editor/index.esm.js +0 -7006
- package/designer/expression-editor/index.umd.cjs +0 -427
- package/designer/filter-condition-editor/index.css +0 -1
- package/designer/filter-condition-editor/index.esm.js +0 -4795
- package/designer/filter-condition-editor/index.umd.cjs +0 -1
- package/designer/html-template/index.esm.js +0 -718
- package/designer/html-template/index.umd.cjs +0 -1
- package/designer/image-cropper/index.esm.js +0 -765
- package/designer/image-cropper/index.umd.cjs +0 -1
- package/designer/json-editor/index.esm.js +0 -83
- package/designer/json-editor/index.umd.cjs +0 -1
- package/designer/language-textbox/index.esm.js +0 -783
- package/designer/language-textbox/index.umd.cjs +0 -8
- package/designer/layout/index.esm.js +0 -430
- package/designer/layout/index.umd.cjs +0 -1
- package/designer/list-nav/index.esm.js +0 -802
- package/designer/list-nav/index.umd.cjs +0 -1
- package/designer/lookup/index.esm.js +0 -2083
- package/designer/lookup/index.umd.cjs +0 -1
- package/designer/menu-lookup/index.esm.js +0 -46
- package/designer/menu-lookup/index.umd.cjs +0 -1
- package/designer/nav/index.esm.js +0 -284
- package/designer/nav/index.umd.cjs +0 -1
- package/designer/number-range/index.esm.js +0 -1616
- package/designer/number-range/index.umd.cjs +0 -1
- package/designer/order/index.css +0 -1
- package/designer/order/index.esm.js +0 -2196
- package/designer/order/index.umd.cjs +0 -18
- package/designer/page-footer/index.esm.js +0 -290
- package/designer/page-footer/index.umd.cjs +0 -1
- package/designer/page-header/index.esm.js +0 -1003
- package/designer/page-header/index.umd.cjs +0 -1
- package/designer/pagination/index.esm.js +0 -591
- package/designer/pagination/index.umd.cjs +0 -1
- package/designer/progress/index.esm.js +0 -213
- package/designer/progress/index.umd.cjs +0 -1
- package/designer/search-box/index.esm.js +0 -245
- package/designer/search-box/index.umd.cjs +0 -1
- package/designer/smoke-detector/index.css +0 -1
- package/designer/smoke-detector/index.esm.js +0 -178
- package/designer/smoke-detector/index.umd.cjs +0 -1
- package/designer/sort-condition-editor/index.esm.js +0 -138
- package/designer/sort-condition-editor/index.umd.cjs +0 -1
- package/designer/splitter/index.esm.js +0 -1120
- package/designer/splitter/index.umd.cjs +0 -1
- package/designer/step/index.esm.js +0 -226
- package/designer/step/index.umd.cjs +0 -1
- package/designer/text/index.esm.js +0 -147
- package/designer/text/index.umd.cjs +0 -1
- package/designer/transfer/index.esm.js +0 -254
- package/designer/transfer/index.umd.cjs +0 -1
- package/designer/tree-view/index.esm.js +0 -313
- package/designer/tree-view/index.umd.cjs +0 -1
- package/designer/uploader/index.esm.js +0 -1190
- package/designer/uploader/index.umd.cjs +0 -2
- package/designer/verify-detail/index.esm.js +0 -258
- package/designer/verify-detail/index.umd.cjs +0 -1
- package/designer/video/index.esm.js +0 -136
- package/designer/video/index.umd.cjs +0 -1
- package/designer/weather/index.css +0 -1
- package/designer/weather/index.esm.js +0 -6244
- package/designer/weather/index.umd.cjs +0 -14
- package/types/accordion/designer.d.ts +0 -44
- package/types/avatar/designer.d.ts +0 -29
- package/types/button-group/designer.d.ts +0 -29
- package/types/code-editor/designer.d.ts +0 -5
- package/types/color-picker/designer.d.ts +0 -29
- package/types/combo-list/designer.d.ts +0 -29
- package/types/combo-list/src/designer/combo-list.design.props.d.ts +0 -6
- package/types/combo-tree/designer.d.ts +0 -5
- package/types/component/designer.d.ts +0 -35
- package/types/condition/designer.d.ts +0 -56
- package/types/dropdown/designer.d.ts +0 -6
- package/types/dynamic-form/src/composition/use-input-type-resolver.d.ts +0 -11
- package/types/expression-editor/designer.d.ts +0 -9
- package/types/filter-condition-editor/designer.d.ts +0 -10
- package/types/html-template/designer.d.ts +0 -31
- package/types/html-template/src/designer/html-template.design.props.d.ts +0 -9
- package/types/image-cropper/designer.d.ts +0 -4
- package/types/json-editor/designer.d.ts +0 -5
- package/types/layout/designer.d.ts +0 -32
- package/types/list-nav/designer.d.ts +0 -6
- package/types/menu-lookup/designer.d.ts +0 -5
- package/types/nav/designer.d.ts +0 -6
- package/types/number-range/designer.d.ts +0 -29
- package/types/order/designer.d.ts +0 -6
- package/types/page-footer/designer.d.ts +0 -6
- package/types/page-header/src/designer/page-header.design.props.d.ts +0 -20
- package/types/pagination/designer.d.ts +0 -29
- package/types/progress/designer.d.ts +0 -29
- package/types/search-box/designer.d.ts +0 -52
- package/types/smoke-detector/designer.d.ts +0 -6
- package/types/sort-condition-editor/designer.d.ts +0 -9
- package/types/splitter/designer.d.ts +0 -32
- package/types/step/designer.d.ts +0 -6
- package/types/text/designer.d.ts +0 -6
- package/types/transfer/designer.d.ts +0 -35
- package/types/tree-view/designer.d.ts +0 -29
- package/types/uploader/designer.d.ts +0 -141
- package/types/verify-detail/designer.d.ts +0 -6
- package/types/video/designer.d.ts +0 -6
- /package/{designer → components}/condition/index.css +0 -0
- /package/{designer → components}/uploader/index.css +0 -0
|
@@ -1,9 +1,117 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var xe = (u, e, i) => e in u ? He(u, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : u[e] = i;
|
|
3
|
+
var n = (u, e, i) => xe(u, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { ref as b, defineComponent as Z, onMounted as K, watch as E, createVNode as y, withModifiers as Q, createTextVNode as fe, computed as O, onBeforeMount as we, withDirectives as q, vShow as J, vModelText as ye, inject as Be } from "vue";
|
|
5
|
+
import { resolveAppearance as Me, createPropsResolver as $e } from "../dynamic-resolver/index.esm.js";
|
|
6
|
+
import { useDesignerComponent as Re } from "../designer-canvas/index.esm.js";
|
|
7
|
+
import { withInstall as Ve } from "../common/index.esm.js";
|
|
8
|
+
const Ne = "https://json-schema.org/draft/2020-12/schema", Ee = "https://farris-design.gitee.io/color-picker.schema.json", Ae = "color-picker", Oe = "A Farris Component", Le = "object", je = {
|
|
9
|
+
id: {
|
|
10
|
+
description: "The unique identifier for color picker",
|
|
11
|
+
type: "string"
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
description: "The type string of color picker",
|
|
15
|
+
type: "string",
|
|
16
|
+
default: "color-picker"
|
|
17
|
+
},
|
|
18
|
+
appearance: {
|
|
19
|
+
description: "",
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
class: {
|
|
23
|
+
type: "string"
|
|
24
|
+
},
|
|
25
|
+
style: {
|
|
26
|
+
type: "string"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
default: {}
|
|
30
|
+
},
|
|
31
|
+
binding: {
|
|
32
|
+
description: "",
|
|
33
|
+
type: "object",
|
|
34
|
+
default: {}
|
|
35
|
+
},
|
|
36
|
+
disable: {
|
|
37
|
+
type: "string",
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
editable: {
|
|
41
|
+
description: "",
|
|
42
|
+
type: "boolean",
|
|
43
|
+
default: !0
|
|
44
|
+
},
|
|
45
|
+
placeholder: {
|
|
46
|
+
description: "",
|
|
47
|
+
type: "string",
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
readonly: {
|
|
51
|
+
description: "",
|
|
52
|
+
type: "boolean",
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
require: {
|
|
56
|
+
description: "",
|
|
57
|
+
type: "boolean",
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
tabindex: {
|
|
61
|
+
description: "",
|
|
62
|
+
type: "number",
|
|
63
|
+
default: -1
|
|
64
|
+
},
|
|
65
|
+
visible: {
|
|
66
|
+
description: "",
|
|
67
|
+
type: "boolean",
|
|
68
|
+
default: !0
|
|
69
|
+
}
|
|
70
|
+
}, Fe = [
|
|
71
|
+
"id",
|
|
72
|
+
"type"
|
|
73
|
+
], Ue = {
|
|
74
|
+
$schema: Ne,
|
|
75
|
+
$id: Ee,
|
|
76
|
+
title: Ae,
|
|
77
|
+
description: Oe,
|
|
78
|
+
type: Le,
|
|
79
|
+
properties: je,
|
|
80
|
+
required: Fe
|
|
81
|
+
};
|
|
82
|
+
function qe(u, e, i) {
|
|
83
|
+
return e;
|
|
84
|
+
}
|
|
85
|
+
const De = /* @__PURE__ */ new Map([
|
|
86
|
+
["appearance", Me]
|
|
87
|
+
]), Xe = "color-picker", Ce = "A Farris Component", Ye = "object", Ge = {
|
|
88
|
+
basic: {
|
|
89
|
+
description: "Basic Infomation",
|
|
90
|
+
title: "基本信息",
|
|
91
|
+
properties: {
|
|
92
|
+
id: {
|
|
93
|
+
description: "组件标识",
|
|
94
|
+
title: "标识",
|
|
95
|
+
type: "string",
|
|
96
|
+
readonly: !0
|
|
97
|
+
},
|
|
98
|
+
type: {
|
|
99
|
+
description: "组件类型",
|
|
100
|
+
title: "控件类型",
|
|
101
|
+
type: "select",
|
|
102
|
+
editor: {
|
|
103
|
+
type: "waiting for modification",
|
|
104
|
+
enum: []
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, We = {
|
|
110
|
+
title: Xe,
|
|
111
|
+
description: Ce,
|
|
112
|
+
type: Ye,
|
|
113
|
+
categories: Ge
|
|
114
|
+
}, ve = {
|
|
7
115
|
/** 初始颜色 */
|
|
8
116
|
color: { type: String, default: "#e1e2e3" },
|
|
9
117
|
/** 禁用 */
|
|
@@ -15,12 +123,12 @@ const bt = {
|
|
|
15
123
|
/** 颜色值变化事件 */
|
|
16
124
|
onValueChanged: { type: Function, default: () => {
|
|
17
125
|
} }
|
|
18
|
-
};
|
|
19
|
-
class
|
|
126
|
+
}, ke = $e(ve, Ue, De, qe, We);
|
|
127
|
+
class ie {
|
|
20
128
|
}
|
|
21
|
-
class
|
|
22
|
-
constructor(
|
|
23
|
-
super(), this.cyan =
|
|
129
|
+
class pe extends ie {
|
|
130
|
+
constructor(e, i, t, r) {
|
|
131
|
+
super(), this.cyan = e, this.magenta = i, this.yellow = t, this.black = r;
|
|
24
132
|
}
|
|
25
133
|
toString() {
|
|
26
134
|
return `cmyk(${this.getCyan()}%, ${this.getMagenta()}%, ${this.getYellow()}%, ${this.getBlack()}%)`;
|
|
@@ -38,12 +146,12 @@ class T extends W {
|
|
|
38
146
|
return Math.round(this.black);
|
|
39
147
|
}
|
|
40
148
|
}
|
|
41
|
-
class
|
|
42
|
-
constructor(
|
|
43
|
-
super(), this.hue =
|
|
149
|
+
class ee extends ie {
|
|
150
|
+
constructor(e, i, t, r) {
|
|
151
|
+
super(), this.hue = e, this.saturation = i, this.lightness = t, this.alpha = r;
|
|
44
152
|
}
|
|
45
|
-
toString(
|
|
46
|
-
return
|
|
153
|
+
toString(e = !0) {
|
|
154
|
+
return e ? `hsla(${this.getHue()}, ${this.getSaturation()}%, ${this.getLightness()}%, ${this.getAlpha()})` : `hsl(${this.getHue()}, ${this.getSaturation()}%, ${this.getLightness()}%)`;
|
|
47
155
|
}
|
|
48
156
|
getHue() {
|
|
49
157
|
return Math.round(this.hue);
|
|
@@ -58,12 +166,12 @@ class F extends W {
|
|
|
58
166
|
return Math.round(this.alpha * 100) / 100;
|
|
59
167
|
}
|
|
60
168
|
}
|
|
61
|
-
class
|
|
62
|
-
constructor(
|
|
63
|
-
super(), this.hue =
|
|
169
|
+
class te extends ie {
|
|
170
|
+
constructor(e, i, t, r) {
|
|
171
|
+
super(), this.hue = e, this.saturation = i, this.value = t, this.alpha = r;
|
|
64
172
|
}
|
|
65
|
-
toString(
|
|
66
|
-
return
|
|
173
|
+
toString(e = !0) {
|
|
174
|
+
return e ? `hsva(${this.getHue()}, ${this.getSaturation()}%, ${this.getValue()}%, ${this.getAlpha()})` : `hsv(${this.getHue()}, ${this.getSaturation()}%, ${this.getValue()}%)`;
|
|
67
175
|
}
|
|
68
176
|
getHue() {
|
|
69
177
|
return Math.round(this.hue);
|
|
@@ -78,12 +186,12 @@ class q extends W {
|
|
|
78
186
|
return Math.round(this.alpha * 100) / 100;
|
|
79
187
|
}
|
|
80
188
|
}
|
|
81
|
-
class
|
|
82
|
-
constructor(
|
|
83
|
-
super(), this.red =
|
|
189
|
+
class s extends ie {
|
|
190
|
+
constructor(e, i, t, r) {
|
|
191
|
+
super(), this.red = e, this.green = i, this.blue = t, this.alpha = r;
|
|
84
192
|
}
|
|
85
|
-
toString(
|
|
86
|
-
return
|
|
193
|
+
toString(e = !0) {
|
|
194
|
+
return e ? `rgba(${this.getRed()}, ${this.getGreen()}, ${this.getBlue()}, ${this.getAlpha()})` : `rgb(${this.getRed()}, ${this.getGreen()}, ${this.getBlue()})`;
|
|
87
195
|
}
|
|
88
196
|
getRed() {
|
|
89
197
|
return Math.round(this.red);
|
|
@@ -98,12 +206,12 @@ class a extends W {
|
|
|
98
206
|
return Math.round(this.alpha * 100) / 100;
|
|
99
207
|
}
|
|
100
208
|
}
|
|
101
|
-
const
|
|
209
|
+
const a = class a {
|
|
102
210
|
};
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
class
|
|
106
|
-
constructor(
|
|
211
|
+
n(a, "transparent", new s(0, 0, 0, 0)), n(a, "aliceblue", new s(240, 248, 255, 1)), n(a, "antiquewhite", new s(250, 235, 215, 1)), n(a, "aqua", new s(0, 255, 255, 1)), n(a, "aquamarine", new s(127, 255, 212, 1)), n(a, "azure", new s(240, 255, 255, 1)), n(a, "beige", new s(245, 245, 220, 1)), n(a, "bisque", new s(255, 228, 196, 1)), n(a, "black", new s(0, 0, 0, 1)), n(a, "blanchedalmond", new s(255, 235, 205, 1)), n(a, "blue", new s(0, 0, 255, 1)), n(a, "blueviolet", new s(138, 43, 226, 1)), n(a, "brown", new s(165, 42, 42, 1)), n(a, "burlywood", new s(222, 184, 135, 1)), n(a, "cadetblue", new s(95, 158, 160, 1)), n(a, "chartreuse", new s(127, 255, 0, 1)), n(a, "chocolate", new s(210, 105, 30, 1)), n(a, "coral", new s(255, 127, 80, 1)), n(a, "cornflowerblue", new s(100, 149, 237, 1)), n(a, "cornsilk", new s(255, 248, 220, 1)), n(a, "crimson", new s(220, 20, 60, 1)), n(a, "cyan", new s(0, 255, 255, 1)), n(a, "darkblue", new s(0, 0, 139, 1)), n(a, "darkcyan", new s(0, 139, 139, 1)), n(a, "darkgoldenrod", new s(184, 134, 11, 1)), n(a, "darkgray", new s(169, 169, 169, 1)), n(a, "darkgreen", new s(0, 100, 0, 1)), n(a, "darkgrey", a.darkgray), n(a, "darkkhaki", new s(189, 183, 107, 1)), n(a, "darkmagenta", new s(139, 0, 139, 1)), n(a, "darkolivegreen", new s(85, 107, 47, 1)), n(a, "darkorange", new s(255, 140, 0, 1)), n(a, "darkorchid", new s(153, 50, 204, 1)), n(a, "darkred", new s(139, 0, 0, 1)), n(a, "darksalmon", new s(233, 150, 122, 1)), n(a, "darkseagreen", new s(143, 188, 143, 1)), n(a, "darkslateblue", new s(72, 61, 139, 1)), n(a, "darkslategray", new s(47, 79, 79, 1)), n(a, "darkslategrey", a.darkslategray), n(a, "darkturquoise", new s(0, 206, 209, 1)), n(a, "darkviolet", new s(148, 0, 211, 1)), n(a, "deeppink", new s(255, 20, 147, 1)), n(a, "deepskyblue", new s(0, 191, 255, 1)), n(a, "dimgray", new s(105, 105, 105, 1)), n(a, "dimgrey", a.dimgray), n(a, "dodgerblue", new s(30, 144, 255, 1)), n(a, "firebrick", new s(178, 34, 34, 1)), n(a, "floralwhite", new s(255, 250, 240, 1)), n(a, "forestgreen", new s(34, 139, 34, 1)), n(a, "fuchsia", new s(255, 0, 255, 1)), n(a, "gainsboro", new s(220, 220, 220, 1)), n(a, "ghostwhite", new s(248, 248, 255, 1)), n(a, "gold", new s(255, 215, 0, 1)), n(a, "goldenrod", new s(218, 165, 32, 1)), n(a, "gray", new s(128, 128, 128, 1)), n(a, "grey", a.gray), n(a, "green", new s(0, 128, 0, 1)), n(a, "greenyellow", new s(173, 255, 47, 1)), n(a, "honeydew", new s(240, 255, 240, 1)), n(a, "hotpink", new s(255, 105, 180, 1)), n(a, "indianred", new s(205, 92, 92, 1)), n(a, "indigo", new s(75, 0, 130, 1)), n(a, "ivory", new s(255, 255, 240, 1)), n(a, "khaki", new s(240, 230, 140, 1)), n(a, "lavender", new s(230, 230, 250, 1)), n(a, "lavenderblush", new s(255, 240, 245, 1)), n(a, "lawngreen", new s(124, 252, 0, 1)), n(a, "lemonchiffon", new s(255, 250, 205, 1)), n(a, "lightblue", new s(173, 216, 230, 1)), n(a, "lightcoral", new s(240, 128, 128, 1)), n(a, "lightcyan", new s(224, 255, 255, 1)), n(a, "lightgoldenrodyellow", new s(250, 250, 210, 1)), n(a, "lightgray", new s(211, 211, 211, 1)), n(a, "lightgreen", new s(144, 238, 144, 1)), n(a, "lightgrey", a.lightgray), n(a, "lightpink", new s(255, 182, 193, 1)), n(a, "lightsalmon", new s(255, 160, 122, 1)), n(a, "lightseagreen", new s(32, 178, 170, 1)), n(a, "lightskyblue", new s(135, 206, 250, 1)), n(a, "lightslategray", new s(119, 136, 153, 1)), n(a, "lightslategrey", a.lightslategray), n(a, "lightsteelblue", new s(176, 196, 222, 1)), n(a, "lightyellow", new s(255, 255, 224, 1)), n(a, "lime", new s(0, 255, 0, 1)), n(a, "limegreen", new s(50, 205, 50, 1)), n(a, "linen", new s(250, 240, 230, 1)), n(a, "magenta", new s(255, 0, 255, 1)), n(a, "maroon", new s(128, 0, 0, 1)), n(a, "mediumaquamarine", new s(102, 205, 170, 1)), n(a, "mediumblue", new s(0, 0, 205, 1)), n(a, "mediumorchid", new s(186, 85, 211, 1)), n(a, "mediumpurple", new s(147, 112, 219, 1)), n(a, "mediumseagreen", new s(60, 179, 113, 1)), n(a, "mediumslateblue", new s(123, 104, 238, 1)), n(a, "mediumspringgreen", new s(0, 250, 154, 1)), n(a, "mediumturquoise", new s(72, 209, 204, 1)), n(a, "mediumvioletred", new s(199, 21, 133, 1)), n(a, "midnightblue", new s(25, 25, 112, 1)), n(a, "mintcream", new s(245, 255, 250, 1)), n(a, "mistyrose", new s(255, 228, 225, 1)), n(a, "moccasin", new s(255, 228, 181, 1)), n(a, "navajowhite", new s(255, 222, 173, 1)), n(a, "navy", new s(0, 0, 128, 1)), n(a, "oldlace", new s(253, 245, 230, 1)), n(a, "olive", new s(128, 128, 0, 1)), n(a, "olivedrab", new s(107, 142, 35, 1)), n(a, "orange", new s(255, 165, 0, 1)), n(a, "orangered", new s(255, 69, 0, 1)), n(a, "orchid", new s(218, 112, 214, 1)), n(a, "palegoldenrod", new s(238, 232, 170, 1)), n(a, "palegreen", new s(152, 251, 152, 1)), n(a, "paleturquoise", new s(175, 238, 238, 1)), n(a, "palevioletred", new s(219, 112, 147, 1)), n(a, "papayawhip", new s(255, 239, 213, 1)), n(a, "peachpuff", new s(255, 218, 185, 1)), n(a, "peru", new s(205, 133, 63, 1)), n(a, "pink", new s(255, 192, 203, 1)), n(a, "plum", new s(221, 160, 221, 1)), n(a, "powderblue", new s(176, 224, 230, 1)), n(a, "purple", new s(128, 0, 128, 1)), n(a, "red", new s(255, 0, 0, 1)), n(a, "rosybrown", new s(188, 143, 143, 1)), n(a, "royalblue", new s(65, 105, 225, 1)), n(a, "saddlebrown", new s(139, 69, 19, 1)), n(a, "salmon", new s(250, 128, 114, 1)), n(a, "sandybrown", new s(244, 164, 96, 1)), n(a, "seagreen", new s(46, 139, 87, 1)), n(a, "seashell", new s(255, 245, 238, 1)), n(a, "sienna", new s(160, 82, 45, 1)), n(a, "silver", new s(192, 192, 192, 1)), n(a, "skyblue", new s(135, 206, 235, 1)), n(a, "slateblue", new s(106, 90, 205, 1)), n(a, "slategray", new s(112, 128, 144, 1)), n(a, "slategrey", a.slategray), n(a, "snow", new s(255, 250, 250, 1)), n(a, "springgreen", new s(0, 255, 127, 1)), n(a, "steelblue", new s(70, 130, 180, 1)), n(a, "tan", new s(210, 180, 140, 1)), n(a, "teal", new s(0, 128, 128, 1)), n(a, "thistle", new s(216, 191, 216, 1)), n(a, "tomato", new s(255, 99, 71, 1)), n(a, "turquoise", new s(64, 224, 208, 1)), n(a, "violet", new s(238, 130, 238, 1)), n(a, "wheat", new s(245, 222, 179, 1)), n(a, "white", new s(255, 255, 255, 1)), n(a, "whitesmoke", new s(245, 245, 245, 1)), n(a, "yellow", new s(255, 255, 0, 1)), n(a, "yellowgreen", new s(154, 205, 50, 1));
|
|
212
|
+
let ge = a;
|
|
213
|
+
class I {
|
|
214
|
+
constructor(e) {
|
|
107
215
|
/**
|
|
108
216
|
* base color used to calculate other
|
|
109
217
|
* default color
|
|
@@ -111,51 +219,51 @@ class P {
|
|
|
111
219
|
* hsl(0, 100%, 50%)
|
|
112
220
|
* 初始色#ff0000
|
|
113
221
|
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
222
|
+
n(this, "hsva", new te(0, 1, 1, 1));
|
|
223
|
+
n(this, "rgba", new s(255, 0, 0, 1));
|
|
224
|
+
e && this.stringToColor(e);
|
|
117
225
|
}
|
|
118
|
-
static from(
|
|
119
|
-
return typeof
|
|
226
|
+
static from(e) {
|
|
227
|
+
return typeof e == "string" ? new I(e) : e instanceof I ? e.clone() : e instanceof s ? new I().setRgba(e.red, e.green, e.blue, e.alpha) : e instanceof te ? new I().setHsva(e.hue, e.saturation, e.value, e.alpha) : e instanceof ee ? new I().setHsla(e.hue, e.saturation, e.lightness, e.alpha) : new I(e);
|
|
120
228
|
}
|
|
121
229
|
/**
|
|
122
230
|
* make from existing color new color object
|
|
123
231
|
*/
|
|
124
232
|
clone() {
|
|
125
|
-
return
|
|
233
|
+
return I.from(this.getRgba());
|
|
126
234
|
}
|
|
127
235
|
/**
|
|
128
236
|
* define Color from hex, rgb, rgba, hsl, hsla or cmyk string
|
|
129
237
|
*/
|
|
130
|
-
setFromString(
|
|
131
|
-
return this.stringToColor(
|
|
238
|
+
setFromString(e) {
|
|
239
|
+
return this.stringToColor(e);
|
|
132
240
|
}
|
|
133
241
|
/**
|
|
134
242
|
* define Color from HSV values
|
|
135
243
|
*/
|
|
136
|
-
setHsva(
|
|
137
|
-
return
|
|
244
|
+
setHsva(e, i = 100, t = 100, r = 1) {
|
|
245
|
+
return e != null && (this.hsva.hue = e), i != null && (this.hsva.saturation = i), t != null && (this.hsva.value = t), r != null && (r = r > 1 ? 1 : r < 0 ? 0 : r, this.hsva.alpha = r), this.rgba = this.hsvaToRgba(this.hsva), this;
|
|
138
246
|
}
|
|
139
247
|
/**
|
|
140
248
|
* define Color from RGBa
|
|
141
249
|
*/
|
|
142
|
-
setRgba(
|
|
143
|
-
return
|
|
250
|
+
setRgba(e, i, t, r = 1) {
|
|
251
|
+
return e != null && (this.rgba.red = e), i != null && (this.rgba.green = i), t != null && (this.rgba.blue = t), r != null && (r = r > 1 ? 1 : r < 0 ? 0 : r, this.rgba.alpha = r), this.hsva = this.rgbaToHsva(this.rgba), this;
|
|
144
252
|
}
|
|
145
253
|
/**
|
|
146
254
|
* define Color from HSLa
|
|
147
255
|
*/
|
|
148
|
-
setHsla(
|
|
256
|
+
setHsla(e, i, t, r = 1) {
|
|
149
257
|
r != null && (r = r > 1 ? 1 : r < 0 ? 0 : r, this.rgba.alpha = r);
|
|
150
|
-
const
|
|
151
|
-
return this.rgba = this.hslaToRgba(
|
|
258
|
+
const k = new ee(e, i, t, r);
|
|
259
|
+
return this.rgba = this.hslaToRgba(k), this.hsva = this.rgbaToHsva(this.rgba), this;
|
|
152
260
|
}
|
|
153
261
|
/**
|
|
154
262
|
* return hexadecimal value formatted as '#341d2a' or '#341d2aFF' if alhpa channel is enabled
|
|
155
263
|
*/
|
|
156
|
-
toHexString(
|
|
264
|
+
toHexString(e = !1) {
|
|
157
265
|
let i = "#" + (16777216 | this.rgba.getRed() << 16 | this.rgba.getGreen() << 8 | this.rgba.getBlue()).toString(16).substr(1);
|
|
158
|
-
return
|
|
266
|
+
return e && (i += (256 | Math.round(this.rgba.alpha * 255)).toString(16).substr(1)), i.toUpperCase();
|
|
159
267
|
}
|
|
160
268
|
/**
|
|
161
269
|
* return rgba string formatted as rgba(52, 29, 42, 1)
|
|
@@ -200,10 +308,10 @@ class P {
|
|
|
200
308
|
return this.getCmyk().toString();
|
|
201
309
|
}
|
|
202
310
|
getHsva() {
|
|
203
|
-
return new
|
|
311
|
+
return new te(this.hsva.hue, this.hsva.saturation, this.hsva.value, this.hsva.alpha);
|
|
204
312
|
}
|
|
205
313
|
getRgba() {
|
|
206
|
-
return new
|
|
314
|
+
return new s(this.rgba.red, this.rgba.green, this.rgba.blue, this.rgba.alpha);
|
|
207
315
|
}
|
|
208
316
|
getHsla() {
|
|
209
317
|
return this.rgbaToHsla(this.rgba);
|
|
@@ -211,78 +319,78 @@ class P {
|
|
|
211
319
|
getCmyk() {
|
|
212
320
|
return this.rgbaToCmyk(this.rgba);
|
|
213
321
|
}
|
|
214
|
-
hsvaToHsla(
|
|
215
|
-
const { hue: i } =
|
|
216
|
-
return new
|
|
322
|
+
hsvaToHsla(e) {
|
|
323
|
+
const { hue: i } = e, t = e.saturation / 100, r = e.value / 100, k = (2 - t) * e.value / 2, l = t * r / (k <= 1 ? k : 2 - k) || 0;
|
|
324
|
+
return new ee(i, k * 100, l * 100, e.alpha);
|
|
217
325
|
}
|
|
218
|
-
hslaToHsva(
|
|
219
|
-
const { hue: i } =
|
|
220
|
-
return new
|
|
326
|
+
hslaToHsva(e) {
|
|
327
|
+
const { hue: i } = e, t = e.lightness / 100 * 2, r = e.saturation / 100 * (t <= 1 ? t : 2 - t), k = (t + r) / 2, l = 2 * r / (t + r) || 0;
|
|
328
|
+
return new te(i, l, k, e.alpha);
|
|
221
329
|
}
|
|
222
|
-
rgbaToHsva(
|
|
223
|
-
const i =
|
|
224
|
-
let
|
|
225
|
-
if (
|
|
226
|
-
switch (
|
|
330
|
+
rgbaToHsva(e) {
|
|
331
|
+
const i = e.red / 255, t = e.green / 255, r = e.blue / 255, { alpha: k } = e, l = Math.max(i, t, r), g = Math.min(i, t, r), w = l - g;
|
|
332
|
+
let m = 0, h = l === 0 ? 0 : w / l, d = l;
|
|
333
|
+
if (l !== g) {
|
|
334
|
+
switch (l) {
|
|
227
335
|
case i:
|
|
228
|
-
|
|
336
|
+
m = (t - r) / w + (t < r ? 6 : 0);
|
|
229
337
|
break;
|
|
230
|
-
case
|
|
231
|
-
|
|
338
|
+
case t:
|
|
339
|
+
m = 2 + (r - i) / w;
|
|
232
340
|
break;
|
|
233
341
|
case r:
|
|
234
|
-
|
|
342
|
+
m = 4 + (i - t) / w;
|
|
235
343
|
break;
|
|
236
344
|
}
|
|
237
|
-
|
|
345
|
+
m /= 6;
|
|
238
346
|
}
|
|
239
|
-
return
|
|
347
|
+
return m *= 360, h *= 100, d *= 100, new te(m, h, d, k);
|
|
240
348
|
}
|
|
241
|
-
hsvaToRgba(
|
|
242
|
-
let i = 1,
|
|
243
|
-
const
|
|
244
|
-
switch (
|
|
349
|
+
hsvaToRgba(e) {
|
|
350
|
+
let i = 1, t = 0, r = 0;
|
|
351
|
+
const k = e.saturation / 100, l = e.value / 100, { alpha: g } = e, w = e.hue / 60, m = Math.floor(w), h = w - m, d = (1 - k) * l, v = (1 - k * h) * l, P = (1 - k * (1 - h)) * l;
|
|
352
|
+
switch (m) {
|
|
245
353
|
case 6:
|
|
246
354
|
case 0:
|
|
247
|
-
i =
|
|
355
|
+
i = l, t = P, r = d;
|
|
248
356
|
break;
|
|
249
357
|
case 1:
|
|
250
|
-
i =
|
|
358
|
+
i = v, t = l, r = d;
|
|
251
359
|
break;
|
|
252
360
|
case 2:
|
|
253
|
-
i =
|
|
361
|
+
i = d, t = l, r = P;
|
|
254
362
|
break;
|
|
255
363
|
case 3:
|
|
256
|
-
i =
|
|
364
|
+
i = d, t = v, r = l;
|
|
257
365
|
break;
|
|
258
366
|
case 4:
|
|
259
|
-
i =
|
|
367
|
+
i = P, t = d, r = l;
|
|
260
368
|
break;
|
|
261
369
|
case 5:
|
|
262
|
-
i =
|
|
370
|
+
i = l, t = d, r = v;
|
|
263
371
|
break;
|
|
264
372
|
}
|
|
265
|
-
return i *= 255,
|
|
266
|
-
}
|
|
267
|
-
rgbaToHsla(
|
|
268
|
-
const i =
|
|
269
|
-
let
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
272
|
-
switch (
|
|
373
|
+
return i *= 255, t *= 255, r *= 255, new s(i, t, r, g);
|
|
374
|
+
}
|
|
375
|
+
rgbaToHsla(e) {
|
|
376
|
+
const i = e.red / 255, t = e.green / 255, r = e.blue / 255, { alpha: k } = e, l = Math.max(i, t, r), g = Math.min(i, t, r);
|
|
377
|
+
let w = 0, m = 0, h = (l + g) / 2;
|
|
378
|
+
const d = l - g;
|
|
379
|
+
if (l !== g) {
|
|
380
|
+
switch (m = h > 0.5 ? d / (2 - l - g) : d / (l + g), l) {
|
|
273
381
|
case i:
|
|
274
|
-
|
|
382
|
+
w = (t - r) / d + (t < r ? 6 : 0);
|
|
275
383
|
break;
|
|
276
|
-
case
|
|
277
|
-
|
|
384
|
+
case t:
|
|
385
|
+
w = (r - i) / d + 2;
|
|
278
386
|
break;
|
|
279
387
|
case r:
|
|
280
|
-
|
|
388
|
+
w = (i - t) / d + 4;
|
|
281
389
|
break;
|
|
282
390
|
}
|
|
283
|
-
|
|
391
|
+
w /= 6;
|
|
284
392
|
}
|
|
285
|
-
return
|
|
393
|
+
return w *= 360, m *= 100, h *= 100, new ee(w, m, h, k);
|
|
286
394
|
}
|
|
287
395
|
/**
|
|
288
396
|
* convert rgb color from HSLa
|
|
@@ -291,17 +399,17 @@ class P {
|
|
|
291
399
|
* saturation = 0 => 1
|
|
292
400
|
* lightness = 0 => 1
|
|
293
401
|
*/
|
|
294
|
-
hslaToRgba(
|
|
295
|
-
const i =
|
|
296
|
-
let
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
|
|
402
|
+
hslaToRgba(e) {
|
|
403
|
+
const i = e.hue / 360, t = e.saturation / 100, r = e.lightness / 100, { alpha: k } = e;
|
|
404
|
+
let l = r, g = r, w = r;
|
|
405
|
+
if (t !== 0) {
|
|
406
|
+
const m = r < 0.5 ? r * (1 + t) : r + t - r * t, h = 2 * r - m;
|
|
407
|
+
l = this.hueToRgb(h, m, i + 1 / 3), g = this.hueToRgb(h, m, i), w = this.hueToRgb(h, m, i - 1 / 3);
|
|
300
408
|
}
|
|
301
|
-
return
|
|
409
|
+
return l *= 255, g *= 255, w *= 255, new s(l, g, w, k);
|
|
302
410
|
}
|
|
303
|
-
hueToRgb(
|
|
304
|
-
return
|
|
411
|
+
hueToRgb(e, i, t) {
|
|
412
|
+
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? e + (i - e) * 6 * t : t < 1 / 2 ? i : t < 2 / 3 ? e + (i - e) * (2 / 3 - t) * 6 : e;
|
|
305
413
|
}
|
|
306
414
|
/**
|
|
307
415
|
* The Red, Green, Blue values are given in the range of 0..255,
|
|
@@ -316,10 +424,10 @@ class P {
|
|
|
316
424
|
* Green = 255 × 1 - min(1 - Magenta ÷ 100) × (1 - Black)
|
|
317
425
|
* Blue = 255 × 1 - min(1 - Yellow ÷ 100) × (1 - Black)
|
|
318
426
|
*/
|
|
319
|
-
cmykToRgba(
|
|
320
|
-
const i =
|
|
321
|
-
let
|
|
322
|
-
return
|
|
427
|
+
cmykToRgba(e) {
|
|
428
|
+
const i = e.black / 100, t = e.cyan / 100, r = e.magenta / 100, k = e.yellow / 100;
|
|
429
|
+
let l = Math.min(1, (1 - t) * (1 - i)), g = Math.min(1, (1 - r) * (1 - i)), w = Math.min(1, (1 - k) * (1 - i));
|
|
430
|
+
return l *= 255, g *= 255, w *= 255, new s(l, g, w, 1);
|
|
323
431
|
}
|
|
324
432
|
/**
|
|
325
433
|
* The max number of R, G, B values are 255, first of all, we divided them by 255 to become the number
|
|
@@ -344,118 +452,118 @@ class P {
|
|
|
344
452
|
* The yellow color(Y) is calculated from the blue and black colors:
|
|
345
453
|
* Y = (1 - Bc - K) ÷ ( 1 - K)
|
|
346
454
|
*/
|
|
347
|
-
rgbaToCmyk(
|
|
348
|
-
const i =
|
|
349
|
-
let
|
|
350
|
-
return
|
|
455
|
+
rgbaToCmyk(e) {
|
|
456
|
+
const i = e.red / 255, t = e.green / 255, r = e.blue / 255;
|
|
457
|
+
let k = 1 - i, l = 1 - t, g = 1 - r, w = Math.min(k, l, g);
|
|
458
|
+
return w === 1 ? new pe(0, 0, 0, 1) : (k = (k - w) / (1 - w), l = (l - w) / (1 - w), g = (g - w) / (1 - w), w *= 100, k *= 100, l *= 100, g *= 100, new pe(k, l, g, w));
|
|
351
459
|
}
|
|
352
|
-
roundNumber(
|
|
353
|
-
return Math.round(
|
|
460
|
+
roundNumber(e) {
|
|
461
|
+
return Math.round(e * 100) / 100;
|
|
354
462
|
}
|
|
355
|
-
stringToColor(
|
|
356
|
-
const i =
|
|
357
|
-
let
|
|
463
|
+
stringToColor(e) {
|
|
464
|
+
const i = e.replace(/ /g, "").toLowerCase();
|
|
465
|
+
let t = ge[e] || null;
|
|
358
466
|
if (i[0] === "#") {
|
|
359
|
-
let
|
|
360
|
-
const { length:
|
|
361
|
-
let
|
|
362
|
-
if (
|
|
363
|
-
|
|
364
|
-
else if (
|
|
365
|
-
|
|
366
|
-
else if (
|
|
367
|
-
const
|
|
368
|
-
|
|
467
|
+
let l = i.substr(1);
|
|
468
|
+
const { length: g } = l;
|
|
469
|
+
let w = 1, m;
|
|
470
|
+
if (g === 3)
|
|
471
|
+
m = l.split("").map((h) => h + h);
|
|
472
|
+
else if (g === 6)
|
|
473
|
+
m = l.match(/.{2}/g);
|
|
474
|
+
else if (g === 8) {
|
|
475
|
+
const h = l.substr(-2);
|
|
476
|
+
l = l.substr(0, g - 2), w = this.roundNumber(parseInt(h || "FF", 16) / 255), m = l.match(/.{2}/g);
|
|
369
477
|
}
|
|
370
|
-
|
|
478
|
+
m && m.length === 3 && (t = new s(parseInt(m[0], 16), parseInt(m[1], 16), parseInt(m[2], 16), w));
|
|
371
479
|
}
|
|
372
|
-
const r = i.indexOf("("),
|
|
373
|
-
if (r !== -1 &&
|
|
374
|
-
const
|
|
375
|
-
let
|
|
376
|
-
switch (
|
|
480
|
+
const r = i.indexOf("("), k = i.indexOf(")");
|
|
481
|
+
if (r !== -1 && k + 1 === i.length) {
|
|
482
|
+
const l = i.substr(0, r), g = i.substr(r + 1, k - (r + 1)).split(",");
|
|
483
|
+
let w = 1, m, h;
|
|
484
|
+
switch (l) {
|
|
377
485
|
case "rgba":
|
|
378
|
-
|
|
486
|
+
w = parseFloat(g.pop());
|
|
379
487
|
case "rgb":
|
|
380
|
-
|
|
488
|
+
t = new s(parseInt(g[0], 10), parseInt(g[1], 10), parseInt(g[2], 10), w);
|
|
381
489
|
break;
|
|
382
490
|
case "hsla":
|
|
383
|
-
|
|
491
|
+
w = parseFloat(g.pop());
|
|
384
492
|
break;
|
|
385
493
|
case "hsl":
|
|
386
|
-
|
|
387
|
-
parseInt(
|
|
388
|
-
parseInt(
|
|
389
|
-
parseInt(
|
|
390
|
-
|
|
391
|
-
),
|
|
494
|
+
m = new ee(
|
|
495
|
+
parseInt(g[0], 10),
|
|
496
|
+
parseInt(g[1], 10),
|
|
497
|
+
parseInt(g[2], 10),
|
|
498
|
+
w
|
|
499
|
+
), t = this.hslaToRgba(m);
|
|
392
500
|
break;
|
|
393
501
|
case "cmyk":
|
|
394
|
-
|
|
395
|
-
parseInt(
|
|
396
|
-
parseInt(
|
|
397
|
-
parseInt(
|
|
398
|
-
parseInt(
|
|
399
|
-
),
|
|
502
|
+
h = new pe(
|
|
503
|
+
parseInt(g[0], 10),
|
|
504
|
+
parseInt(g[1], 10),
|
|
505
|
+
parseInt(g[2], 10),
|
|
506
|
+
parseInt(g[3], 10)
|
|
507
|
+
), t = this.cmykToRgba(h);
|
|
400
508
|
break;
|
|
401
509
|
}
|
|
402
510
|
}
|
|
403
|
-
return
|
|
511
|
+
return t && (this.rgba = t, this.hsva = this.rgbaToHsva(t)), this;
|
|
404
512
|
}
|
|
405
513
|
}
|
|
406
|
-
var
|
|
407
|
-
class
|
|
408
|
-
constructor(
|
|
514
|
+
var B = /* @__PURE__ */ ((u) => (u.hex = "hex", u.hexa = "hexa", u.rgba = "rgba", u.rgb = "rgb", u.hsla = "hsla", u.hsl = "hsl", u.cmyk = "cmyk", u))(B || {});
|
|
515
|
+
class me {
|
|
516
|
+
constructor(e) {
|
|
409
517
|
/** 所选颜色值 */
|
|
410
|
-
|
|
518
|
+
n(this, "modelValue", null);
|
|
411
519
|
/** 色调颜色值 */
|
|
412
|
-
|
|
520
|
+
n(this, "hueValue", null);
|
|
413
521
|
/** 初始颜色值 */
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
522
|
+
n(this, "initValue", null);
|
|
523
|
+
n(this, "valueChanged", b());
|
|
524
|
+
n(this, "initType", null);
|
|
417
525
|
// 此处没有监听变量变更后操作的方法 TODO
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
const i =
|
|
421
|
-
this.setValue(
|
|
526
|
+
n(this, "alphaChannelVisibilityChanges", b());
|
|
527
|
+
n(this, "colorPresets", []);
|
|
528
|
+
const i = e[0], t = I.from(i);
|
|
529
|
+
this.setValue(t), this.setHueColor(t);
|
|
422
530
|
}
|
|
423
531
|
/** 设置值 */
|
|
424
|
-
setValueFrom(
|
|
425
|
-
const r =
|
|
426
|
-
return this.initValue || (this.initValue =
|
|
532
|
+
setValueFrom(e, i, t) {
|
|
533
|
+
const r = I.from(e);
|
|
534
|
+
return this.initValue || (this.initValue = I.from(e)), typeof e == "string" && this.finOutInputType(e), this.setHueColor(r), this.setValue(r), this;
|
|
427
535
|
}
|
|
428
|
-
setHueColor(
|
|
429
|
-
(this.hueValue &&
|
|
536
|
+
setHueColor(e) {
|
|
537
|
+
(this.hueValue && e.getHsva().hue > 0 || !this.hueValue) && (this.hueValue = new I().setHsva(e.getHsva().hue));
|
|
430
538
|
}
|
|
431
539
|
get hue() {
|
|
432
540
|
return this.hueValue;
|
|
433
541
|
}
|
|
434
|
-
set hue(
|
|
435
|
-
this.hueValue =
|
|
542
|
+
set hue(e) {
|
|
543
|
+
this.hueValue = e;
|
|
436
544
|
}
|
|
437
|
-
setValue(
|
|
545
|
+
setValue(e) {
|
|
438
546
|
var i;
|
|
439
|
-
return this.modelValue =
|
|
547
|
+
return this.modelValue = e, (e == null ? void 0 : e.toRgbaString()) === ((i = this.valueChanged.value) == null ? void 0 : i.toRgbaString()) && (this.valueChanged.value = e), this;
|
|
440
548
|
}
|
|
441
549
|
get value() {
|
|
442
550
|
return this.modelValue;
|
|
443
551
|
}
|
|
444
|
-
set value(
|
|
445
|
-
this.setValue(
|
|
552
|
+
set value(e) {
|
|
553
|
+
this.setValue(e);
|
|
446
554
|
}
|
|
447
555
|
reset() {
|
|
448
|
-
let
|
|
449
|
-
return this.initValue ? (
|
|
556
|
+
let e;
|
|
557
|
+
return this.initValue ? (e = this.initValue.clone(), this.setHueColor(e)) : (e = I.from(new s(255, 0, 0, 1)), this.hueValue = new I().setHsva(e.getHsva().hue)), this.setValue(e), this;
|
|
450
558
|
}
|
|
451
559
|
showAlphaChannel() {
|
|
452
560
|
return this.alphaChannelVisibilityChanges.value = !0, this;
|
|
453
561
|
}
|
|
454
|
-
finOutInputType(
|
|
455
|
-
const i =
|
|
562
|
+
finOutInputType(e) {
|
|
563
|
+
const i = e.replace(/ /g, "").toLowerCase();
|
|
456
564
|
i[0] === "#" && (this.initType = "hex", i.length > 7 && (this.initType = "hexa"));
|
|
457
|
-
const
|
|
458
|
-
switch (i.substr(0,
|
|
565
|
+
const t = i.indexOf("(");
|
|
566
|
+
switch (i.substr(0, t)) {
|
|
459
567
|
case "rgba":
|
|
460
568
|
this.initType = "rgba";
|
|
461
569
|
break;
|
|
@@ -474,13 +582,13 @@ class it {
|
|
|
474
582
|
}
|
|
475
583
|
}
|
|
476
584
|
/** 设置预定义颜色 */
|
|
477
|
-
setColorPresets(
|
|
478
|
-
return this.colorPresets = this.setPresets(
|
|
585
|
+
setColorPresets(e) {
|
|
586
|
+
return this.colorPresets = this.setPresets(e), this;
|
|
479
587
|
}
|
|
480
|
-
setPresets(
|
|
588
|
+
setPresets(e) {
|
|
481
589
|
const i = [];
|
|
482
|
-
return
|
|
483
|
-
Array.isArray(
|
|
590
|
+
return e.map((t) => {
|
|
591
|
+
Array.isArray(t) ? i.push(this.setPresets(t)) : i.push(new I(t));
|
|
484
592
|
}), i;
|
|
485
593
|
}
|
|
486
594
|
get presets() {
|
|
@@ -491,101 +599,101 @@ class it {
|
|
|
491
599
|
}
|
|
492
600
|
}
|
|
493
601
|
/** 确定输入颜色类型 */
|
|
494
|
-
|
|
495
|
-
function
|
|
496
|
-
if (!
|
|
602
|
+
n(me, "finOutInputType");
|
|
603
|
+
function V(u, e) {
|
|
604
|
+
if (!u)
|
|
497
605
|
return "";
|
|
498
|
-
switch (
|
|
499
|
-
case
|
|
500
|
-
return
|
|
501
|
-
case
|
|
502
|
-
return
|
|
503
|
-
case
|
|
504
|
-
return
|
|
505
|
-
case
|
|
506
|
-
return
|
|
507
|
-
case
|
|
508
|
-
return
|
|
509
|
-
case
|
|
510
|
-
return
|
|
606
|
+
switch (e) {
|
|
607
|
+
case B.hex:
|
|
608
|
+
return u.toHexString();
|
|
609
|
+
case B.hexa:
|
|
610
|
+
return u.toHexString(!0);
|
|
611
|
+
case B.rgb:
|
|
612
|
+
return u.toRgbString();
|
|
613
|
+
case B.rgba:
|
|
614
|
+
return u.toRgbaString();
|
|
615
|
+
case B.hsl:
|
|
616
|
+
return u.toHslString();
|
|
617
|
+
case B.hsla:
|
|
618
|
+
return u.toHslaString();
|
|
511
619
|
default:
|
|
512
|
-
return
|
|
620
|
+
return u.toRgbaString();
|
|
513
621
|
}
|
|
514
622
|
}
|
|
515
|
-
const
|
|
623
|
+
const ze = {
|
|
516
624
|
color: { type: Object, default: "" },
|
|
517
625
|
hue: { type: Object, default: "" },
|
|
518
626
|
randomId: { type: String, default: "" },
|
|
519
627
|
allowColorNull: { type: Boolean, default: !1 }
|
|
520
|
-
},
|
|
628
|
+
}, be = /* @__PURE__ */ Z({
|
|
521
629
|
name: "SvPanel",
|
|
522
|
-
props:
|
|
630
|
+
props: ze,
|
|
523
631
|
emits: ["update:color"],
|
|
524
|
-
setup(
|
|
525
|
-
const i =
|
|
526
|
-
function
|
|
527
|
-
return
|
|
528
|
-
}
|
|
529
|
-
function d
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
function
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
function
|
|
540
|
-
x:
|
|
541
|
-
y:
|
|
542
|
-
height:
|
|
543
|
-
width:
|
|
632
|
+
setup(u, e) {
|
|
633
|
+
const i = b(null), t = b(null), r = b(u.randomId), k = b(u.allowColorNull);
|
|
634
|
+
function l() {
|
|
635
|
+
return u.hue ? u.hue.toRgbaString() : "#3f51b5";
|
|
636
|
+
}
|
|
637
|
+
function g(d, v) {
|
|
638
|
+
var P, p;
|
|
639
|
+
d = Math.max(0, Math.min(d, 100)), v = Math.max(0, Math.min(v, 100)), i.value && ((P = i.value.style) == null || P.setProperty("top", `${100 - v}%`), (p = i.value.style) == null || p.setProperty("left", `${d}%`));
|
|
640
|
+
}
|
|
641
|
+
function w() {
|
|
642
|
+
const d = document.getElementById(`farris-color-picker-plus-sure-${r.value}`);
|
|
643
|
+
d.className = "btn btn-secondary";
|
|
644
|
+
const v = document.getElementById(`farris-color-picker-plus-input-${r.value}`);
|
|
645
|
+
v.style.borderColor = "#dcdfe6";
|
|
646
|
+
}
|
|
647
|
+
function m({
|
|
648
|
+
x: d,
|
|
649
|
+
y: v,
|
|
650
|
+
height: P,
|
|
651
|
+
width: p
|
|
544
652
|
}) {
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
550
|
-
|
|
653
|
+
const c = d * 100 / p, M = -(v * 100 / P) + 100;
|
|
654
|
+
g(c, M);
|
|
655
|
+
const S = u.color == null ? "transparent" : u.color, H = I.from(S);
|
|
656
|
+
if (w(), H != null) {
|
|
657
|
+
const $ = u.hue.getHsva(), F = H.getHsva(), A = new I().setHsva($.hue, c, M, F.alpha);
|
|
658
|
+
e.emit("update:color", A);
|
|
551
659
|
}
|
|
552
|
-
!
|
|
660
|
+
!H && k.value && e.emit("update:color", null);
|
|
553
661
|
}
|
|
554
|
-
function
|
|
555
|
-
if (
|
|
662
|
+
function h(d) {
|
|
663
|
+
if (t.value) {
|
|
556
664
|
const {
|
|
557
|
-
width:
|
|
558
|
-
height:
|
|
559
|
-
top:
|
|
560
|
-
left:
|
|
561
|
-
} =
|
|
665
|
+
width: v,
|
|
666
|
+
height: P,
|
|
667
|
+
top: p,
|
|
668
|
+
left: c
|
|
669
|
+
} = t.value.getBoundingClientRect(), {
|
|
562
670
|
pageX: M,
|
|
563
|
-
pageY:
|
|
564
|
-
} = "touches" in
|
|
565
|
-
|
|
566
|
-
x:
|
|
567
|
-
y:
|
|
568
|
-
height:
|
|
569
|
-
width:
|
|
671
|
+
pageY: S
|
|
672
|
+
} = "touches" in d ? d.touches[0] : d, H = Math.max(0, Math.min(M - (c + window.pageXOffset), v)), $ = Math.max(0, Math.min(S - (p + window.pageYOffset), P));
|
|
673
|
+
m({
|
|
674
|
+
x: H,
|
|
675
|
+
y: $,
|
|
676
|
+
height: P,
|
|
677
|
+
width: v
|
|
570
678
|
});
|
|
571
679
|
}
|
|
572
680
|
}
|
|
573
|
-
return
|
|
574
|
-
const
|
|
575
|
-
d
|
|
576
|
-
}),
|
|
577
|
-
|
|
578
|
-
}),
|
|
579
|
-
const
|
|
580
|
-
|
|
681
|
+
return K(() => {
|
|
682
|
+
const d = u.color.getHsva();
|
|
683
|
+
g(d.saturation, d.value);
|
|
684
|
+
}), E(() => u.color, (d) => {
|
|
685
|
+
d.getHsva();
|
|
686
|
+
}), E(() => u.color, (d) => {
|
|
687
|
+
const v = d.getHsva();
|
|
688
|
+
g(v.saturation, v.value);
|
|
581
689
|
}), () => y("div", {
|
|
582
690
|
class: "f-sv-panel-component",
|
|
583
|
-
ref:
|
|
691
|
+
ref: t,
|
|
584
692
|
style: {
|
|
585
|
-
backgroundColor:
|
|
693
|
+
backgroundColor: l()
|
|
586
694
|
},
|
|
587
|
-
onMousedown:
|
|
588
|
-
onTouchstart:
|
|
695
|
+
onMousedown: Q((d) => h(d), ["prevent"]),
|
|
696
|
+
onTouchstart: Q((d) => h(d), ["prevent"])
|
|
589
697
|
}, [y("div", {
|
|
590
698
|
class: "color-svpanel__white"
|
|
591
699
|
}, null), y("div", {
|
|
@@ -595,401 +703,603 @@ const Pt = {
|
|
|
595
703
|
ref: i
|
|
596
704
|
}, [y("div", null, null)])]);
|
|
597
705
|
}
|
|
598
|
-
}),
|
|
706
|
+
}), Je = {
|
|
599
707
|
color: { type: Object, default: "" },
|
|
600
708
|
hue: { type: Object, default: "" },
|
|
601
709
|
allowColorNull: { type: Boolean, default: !1 },
|
|
602
710
|
onChange: { type: Function }
|
|
603
|
-
},
|
|
711
|
+
}, Pe = /* @__PURE__ */ Z({
|
|
604
712
|
name: "Hue",
|
|
605
|
-
props:
|
|
713
|
+
props: Je,
|
|
606
714
|
emits: ["update:color", "update:hue"],
|
|
607
|
-
setup(
|
|
608
|
-
const i =
|
|
609
|
-
function
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
const
|
|
613
|
-
function
|
|
614
|
-
if (
|
|
715
|
+
setup(u, e) {
|
|
716
|
+
const i = b(u.hue), t = b(u.allowColorNull), r = [];
|
|
717
|
+
function k(p) {
|
|
718
|
+
p.preventDefault(), g(p);
|
|
719
|
+
}
|
|
720
|
+
const l = b(null);
|
|
721
|
+
function g(p) {
|
|
722
|
+
if (l.value) {
|
|
615
723
|
const {
|
|
616
|
-
width:
|
|
724
|
+
width: c,
|
|
617
725
|
height: M,
|
|
618
|
-
top:
|
|
619
|
-
left:
|
|
620
|
-
} =
|
|
621
|
-
pageX:
|
|
622
|
-
pageY:
|
|
623
|
-
} = "touches" in
|
|
624
|
-
|
|
625
|
-
x:
|
|
726
|
+
top: S,
|
|
727
|
+
left: H
|
|
728
|
+
} = l.value.getBoundingClientRect(), {
|
|
729
|
+
pageX: $,
|
|
730
|
+
pageY: F
|
|
731
|
+
} = "touches" in p ? p.touches[0] : p, A = Math.max(0, Math.min($ - (H + window.pageXOffset), c)), X = Math.max(0, Math.min(F - (S + window.pageYOffset), M));
|
|
732
|
+
P({
|
|
733
|
+
x: A,
|
|
626
734
|
y: X,
|
|
627
735
|
height: M,
|
|
628
|
-
width:
|
|
736
|
+
width: c
|
|
629
737
|
});
|
|
630
738
|
}
|
|
631
739
|
}
|
|
632
|
-
function
|
|
633
|
-
r.forEach((
|
|
740
|
+
function w() {
|
|
741
|
+
r.forEach((p) => p()), r.length = 0;
|
|
634
742
|
}
|
|
635
|
-
function
|
|
636
|
-
|
|
743
|
+
function m(p) {
|
|
744
|
+
k(p), document.addEventListener("mouseup", w), document.addEventListener("touchend", w), document.addEventListener("touchmove", k);
|
|
637
745
|
}
|
|
638
|
-
const
|
|
639
|
-
|
|
746
|
+
const h = (p) => {
|
|
747
|
+
m(p), p.stopPropagation();
|
|
640
748
|
};
|
|
641
|
-
|
|
749
|
+
K(() => {
|
|
642
750
|
document.querySelectorAll(".f-hue-component").forEach((M) => {
|
|
643
|
-
M.addEventListener("mousedown",
|
|
751
|
+
M.addEventListener("mousedown", h), M.addEventListener("touchstart", h);
|
|
644
752
|
});
|
|
645
|
-
const
|
|
646
|
-
|
|
753
|
+
const c = u.color.getHsva();
|
|
754
|
+
v(c.hue);
|
|
647
755
|
});
|
|
648
|
-
const
|
|
649
|
-
function
|
|
650
|
-
var
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
function
|
|
655
|
-
x:
|
|
656
|
-
y:
|
|
756
|
+
const d = b(null);
|
|
757
|
+
function v(p) {
|
|
758
|
+
var S;
|
|
759
|
+
const c = Math.max(0, Math.min(p / 360 * 100, 100));
|
|
760
|
+
d.value && ((S = d.value.style) == null || S.setProperty("top", `${c}%`));
|
|
761
|
+
}
|
|
762
|
+
function P({
|
|
763
|
+
x: p,
|
|
764
|
+
y: c,
|
|
657
765
|
height: M,
|
|
658
|
-
width:
|
|
766
|
+
width: S
|
|
659
767
|
}) {
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
const
|
|
663
|
-
(
|
|
664
|
-
}
|
|
665
|
-
return
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
}),
|
|
669
|
-
const
|
|
670
|
-
|
|
768
|
+
const H = c / M * 360;
|
|
769
|
+
v(H);
|
|
770
|
+
const $ = u.color.getHsva(), F = new I().setHsva(H, $.saturation, $.value, $.alpha), A = new I().setHsva(H, 100, 100, $.alpha);
|
|
771
|
+
(u.color != null || u.color == null && t.value) && (e.emit("update:hue", A), e.emit("update:color", F));
|
|
772
|
+
}
|
|
773
|
+
return E(i, (p) => {
|
|
774
|
+
const c = p.getHsva();
|
|
775
|
+
v(c.hue);
|
|
776
|
+
}), E(() => u.color, (p) => {
|
|
777
|
+
const c = p.getHsva();
|
|
778
|
+
v(c.hue);
|
|
671
779
|
}), () => y("div", {
|
|
672
780
|
class: "f-hue-component",
|
|
673
|
-
ref:
|
|
674
|
-
onMousedown:
|
|
675
|
-
onTouchstart:
|
|
781
|
+
ref: l,
|
|
782
|
+
onMousedown: Q((p) => g(p), ["prevent"]),
|
|
783
|
+
onTouchstart: Q((p) => g(p), ["prevent"])
|
|
676
784
|
}, [y("div", {
|
|
677
785
|
class: "color-hue-slider__bar"
|
|
678
786
|
}, null), y("div", {
|
|
679
787
|
class: "color-hue-slider__thumb",
|
|
680
|
-
ref:
|
|
788
|
+
ref: d
|
|
681
789
|
}, null)]);
|
|
682
790
|
}
|
|
683
|
-
}),
|
|
791
|
+
}), Ke = {
|
|
684
792
|
color: { type: Object, default: "" },
|
|
685
793
|
randomId: { type: String, default: "" },
|
|
686
794
|
allowColorNull: { type: Boolean, default: !1 }
|
|
687
|
-
},
|
|
795
|
+
}, Ie = /* @__PURE__ */ Z({
|
|
688
796
|
name: "Alpha",
|
|
689
|
-
props:
|
|
797
|
+
props: Ke,
|
|
690
798
|
emits: ["update:color"],
|
|
691
|
-
setup(
|
|
692
|
-
const i =
|
|
693
|
-
var
|
|
694
|
-
const
|
|
695
|
-
|
|
799
|
+
setup(u, e) {
|
|
800
|
+
const i = b(null), t = b(null), r = b(u.randomId), k = b(u.allowColorNull), l = (h) => {
|
|
801
|
+
var P;
|
|
802
|
+
const d = Math.max(0, Math.min(h * 100, 100));
|
|
803
|
+
t.value && ((P = t.value.style) == null || P.setProperty("left", `${d}%`));
|
|
696
804
|
};
|
|
697
|
-
function
|
|
805
|
+
function g(h) {
|
|
698
806
|
if (i.value) {
|
|
699
807
|
const {
|
|
700
|
-
width:
|
|
701
|
-
height:
|
|
702
|
-
top:
|
|
703
|
-
left:
|
|
808
|
+
width: d,
|
|
809
|
+
height: v,
|
|
810
|
+
top: P,
|
|
811
|
+
left: p
|
|
704
812
|
} = i.value.getBoundingClientRect(), {
|
|
705
|
-
pageX:
|
|
813
|
+
pageX: c,
|
|
706
814
|
pageY: M
|
|
707
|
-
} = "touches" in
|
|
708
|
-
|
|
709
|
-
x:
|
|
710
|
-
width:
|
|
815
|
+
} = "touches" in h ? h.touches[0] : h, S = Math.max(0, Math.min(c - (p + window.pageXOffset), d));
|
|
816
|
+
m({
|
|
817
|
+
x: S,
|
|
818
|
+
width: d
|
|
711
819
|
});
|
|
712
820
|
}
|
|
713
821
|
}
|
|
714
|
-
function
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
822
|
+
function w() {
|
|
823
|
+
const h = document.getElementById(`farris-color-picker-plus-sure-${r.value}`);
|
|
824
|
+
h.className = "btn btn-secondary";
|
|
825
|
+
const d = document.getElementById(`farris-color-picker-plus-input-${r.value}`);
|
|
826
|
+
d.style.borderColor = "#dcdfe6";
|
|
719
827
|
}
|
|
720
|
-
const
|
|
721
|
-
x:
|
|
722
|
-
width:
|
|
828
|
+
const m = ({
|
|
829
|
+
x: h,
|
|
830
|
+
width: d
|
|
723
831
|
}) => {
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
const
|
|
727
|
-
|
|
832
|
+
const v = h / d;
|
|
833
|
+
l(v), w();
|
|
834
|
+
const P = u.color.getHsva(), p = new I().setHsva(P.hue, P.saturation, P.value, v);
|
|
835
|
+
u.color != null ? e.emit("update:color", p) : u.color == null && k.value && e.emit("update:color", null);
|
|
728
836
|
};
|
|
729
|
-
return
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
}),
|
|
733
|
-
const
|
|
734
|
-
|
|
837
|
+
return K(() => {
|
|
838
|
+
const h = u.color.getHsva();
|
|
839
|
+
l(h.alpha);
|
|
840
|
+
}), E(() => u.color, (h) => {
|
|
841
|
+
const d = h.getHsva();
|
|
842
|
+
l(d.alpha);
|
|
735
843
|
}), () => y("div", {
|
|
736
844
|
class: "f-alpha-component",
|
|
737
845
|
ref: i,
|
|
738
|
-
onMousedown:
|
|
739
|
-
onTouchstart:
|
|
846
|
+
onMousedown: Q((h) => g(h), ["prevent"]),
|
|
847
|
+
onTouchstart: Q((h) => g(h), ["prevent"])
|
|
740
848
|
}, [y("div", {
|
|
741
849
|
class: "color-alpha-slider__bar"
|
|
742
|
-
}, [
|
|
850
|
+
}, [fe(" ")]), y("div", {
|
|
743
851
|
class: "color-alpha-slider__thumb",
|
|
744
|
-
ref:
|
|
852
|
+
ref: t
|
|
745
853
|
}, null)]);
|
|
746
854
|
}
|
|
747
|
-
}),
|
|
855
|
+
}), Qe = {
|
|
748
856
|
color: { type: Object, default: "" },
|
|
749
857
|
hue: { type: Object, default: "" },
|
|
750
858
|
colorPresets: { type: Object, default: "" },
|
|
751
859
|
randomId: { type: String, default: "" }
|
|
752
|
-
},
|
|
860
|
+
}, Se = /* @__PURE__ */ Z({
|
|
753
861
|
name: "Preset",
|
|
754
|
-
props:
|
|
862
|
+
props: Qe,
|
|
755
863
|
emits: ["update:hue", "update:color"],
|
|
756
|
-
setup(
|
|
757
|
-
const i =
|
|
758
|
-
function
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
function
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
i.value =
|
|
768
|
-
}
|
|
769
|
-
function
|
|
770
|
-
const
|
|
864
|
+
setup(u, e) {
|
|
865
|
+
const i = b(new I()), t = b(u.colorPresets), r = b(u.randomId);
|
|
866
|
+
function k() {
|
|
867
|
+
const m = document.getElementById(`farris-color-picker-plus-sure-${r.value}`);
|
|
868
|
+
m.className = "btn btn-secondary";
|
|
869
|
+
const h = document.getElementById(`farris-color-picker-plus-input-${r.value}`);
|
|
870
|
+
h.style.borderColor = "#dcdfe6";
|
|
871
|
+
}
|
|
872
|
+
function l(m) {
|
|
873
|
+
k();
|
|
874
|
+
const h = m.getRgba(), d = m.getHsva(), v = new I().setRgba(h.red, h.green, h.blue, h.alpha), P = new I().setHsva(d.hue);
|
|
875
|
+
i.value = m, e.emit("update:hue", P), e.emit("update:color", v);
|
|
876
|
+
}
|
|
877
|
+
function g(m) {
|
|
878
|
+
const h = i.value.getRgba().toString(), d = i.value.getHsva().toString(), v = m.getRgba().toString() === h && m.getHsva().toString() === d;
|
|
771
879
|
return {
|
|
772
|
-
"color-preset__color-selector":
|
|
773
|
-
selected:
|
|
880
|
+
"color-preset__color-selector": v,
|
|
881
|
+
selected: v
|
|
774
882
|
};
|
|
775
883
|
}
|
|
776
|
-
function
|
|
884
|
+
function w(m, h) {
|
|
777
885
|
return y("div", {
|
|
778
886
|
class: "color-preset__color-selector"
|
|
779
887
|
}, [y("div", {
|
|
780
|
-
key:
|
|
781
|
-
class:
|
|
888
|
+
key: h,
|
|
889
|
+
class: g(m),
|
|
782
890
|
style: {
|
|
783
|
-
backgroundColor:
|
|
891
|
+
backgroundColor: m.toRgbString()
|
|
784
892
|
},
|
|
785
|
-
onClick: () =>
|
|
893
|
+
onClick: () => l(m)
|
|
786
894
|
}, null)]);
|
|
787
895
|
}
|
|
788
896
|
return () => y("div", {
|
|
789
897
|
class: "f-preset-component"
|
|
790
898
|
}, [y("div", {
|
|
791
899
|
class: "color-preset__colors"
|
|
792
|
-
}, [
|
|
900
|
+
}, [t.value.map((m, h) => w(m, h))])]);
|
|
793
901
|
}
|
|
794
|
-
}),
|
|
902
|
+
}), se = /* @__PURE__ */ Z({
|
|
795
903
|
name: "FColorPicker",
|
|
796
|
-
props:
|
|
904
|
+
props: ve,
|
|
797
905
|
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
798
|
-
setup(
|
|
799
|
-
const i =
|
|
800
|
-
let
|
|
801
|
-
const
|
|
802
|
-
let
|
|
803
|
-
const
|
|
906
|
+
setup(u, e) {
|
|
907
|
+
const i = b(new I(u.color)), t = b(u.color), r = b(u.disabled), k = b(u.color), l = b(u.allowColorNull), g = b(u.presets), w = b(!1), m = b(!1), h = b(!1), d = b("HEX"), v = Math.floor(Math.random() * 1e3).toString();
|
|
908
|
+
let P = -1, p;
|
|
909
|
+
const c = new me("#000000"), M = b(u.color);
|
|
910
|
+
let S, H;
|
|
911
|
+
const $ = b(null), F = b(null), A = b(null), X = O(() => !p && c && c.initType ? c.initType : p), R = O({
|
|
804
912
|
get() {
|
|
805
|
-
return
|
|
913
|
+
return p && t.value !== null ? (_(p), V(new I(t.value), B[p])) : t.value;
|
|
806
914
|
},
|
|
807
|
-
set(
|
|
808
|
-
|
|
915
|
+
set(f) {
|
|
916
|
+
f !== null && (U(f), W(f));
|
|
809
917
|
}
|
|
810
|
-
}),
|
|
811
|
-
"background-color":
|
|
812
|
-
})),
|
|
918
|
+
}), C = b(R.value), N = O(() => P > -1), Y = O(() => g.value.length > 0), re = O(() => ({
|
|
919
|
+
"background-color": k.value
|
|
920
|
+
})), ne = O(() => m.value && w.value ? "display:flex" : "display:none"), G = [{
|
|
813
921
|
text: "HEX",
|
|
814
|
-
type:
|
|
922
|
+
type: B.hex
|
|
815
923
|
}, {
|
|
816
924
|
text: "RGBA",
|
|
817
|
-
type:
|
|
925
|
+
type: B.rgba
|
|
818
926
|
}];
|
|
819
|
-
function
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
}
|
|
827
|
-
function
|
|
828
|
-
if (!
|
|
829
|
-
document.getElementById(`farris-color-picker-plus-sure-${
|
|
830
|
-
const
|
|
831
|
-
|
|
927
|
+
function le() {
|
|
928
|
+
const f = document.getElementById("farris-color-picker-panel");
|
|
929
|
+
f.id = `farris-color-picker-panel-${v}`;
|
|
930
|
+
const o = document.getElementById("farris-color-picker-plus-sure");
|
|
931
|
+
o.id = `farris-color-picker-plus-sure-${v}`;
|
|
932
|
+
const x = document.getElementById("farris-color-picker-plus-input");
|
|
933
|
+
x.id = `farris-color-picker-plus-input-${v}`, H = document.getElementById(`farris-color-picker-plus-sure-${v}`), S = document.getElementById(`farris-color-picker-panel-${v}`), S.className = "color-picker-panel disabled";
|
|
934
|
+
}
|
|
935
|
+
function D() {
|
|
936
|
+
if (!l.value && !t.value) {
|
|
937
|
+
document.getElementById(`farris-color-picker-plus-sure-${v}`).classList.toggle("disabled");
|
|
938
|
+
const o = document.getElementById(`farris-color-picker-plus-input-${v}`);
|
|
939
|
+
o.style.borderColor = "red";
|
|
832
940
|
}
|
|
833
941
|
}
|
|
834
|
-
function
|
|
835
|
-
|
|
942
|
+
function ue() {
|
|
943
|
+
t.value && (U(t.value), !t.value && l.value || (t.value = V(new I(t.value), B[X.value])), C.value = R.value), T(_(c.initType));
|
|
836
944
|
}
|
|
837
|
-
function
|
|
838
|
-
|
|
945
|
+
function ae() {
|
|
946
|
+
t.value && U(t.value), c.hasPresets() || c.setColorPresets(g.value), t.value ? k.value = V(new I(t.value), B[X.value]) : !t.value && l.value && (k.value = null);
|
|
839
947
|
}
|
|
840
|
-
function
|
|
841
|
-
|
|
842
|
-
const
|
|
843
|
-
|
|
948
|
+
function oe() {
|
|
949
|
+
E(c.valueChanged, (f) => {
|
|
950
|
+
const o = V(f, B[p || c.initType]);
|
|
951
|
+
t.value = o;
|
|
844
952
|
});
|
|
845
953
|
}
|
|
846
|
-
function
|
|
847
|
-
|
|
848
|
-
}
|
|
849
|
-
function
|
|
850
|
-
var
|
|
851
|
-
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}),
|
|
856
|
-
|
|
857
|
-
}),
|
|
858
|
-
R.value =
|
|
859
|
-
}),
|
|
860
|
-
|
|
861
|
-
}),
|
|
862
|
-
|
|
954
|
+
function T(f) {
|
|
955
|
+
d.value = G[f].text;
|
|
956
|
+
}
|
|
957
|
+
function ce() {
|
|
958
|
+
var f;
|
|
959
|
+
m.value = !!(p != null && p.includes("a") || (f = c.initType) != null && f.includes("a"));
|
|
960
|
+
}
|
|
961
|
+
we(() => {
|
|
962
|
+
c.setColorPresets(g.value || ["#eaecf3"]);
|
|
963
|
+
}), K(() => {
|
|
964
|
+
le(), D(), ue(), ae();
|
|
965
|
+
}), oe(), E(d, () => {
|
|
966
|
+
R.value = V(new I(t.value), B[p || c.initType]), i.value = new I(R.value), ce();
|
|
967
|
+
}), E(t, (f) => {
|
|
968
|
+
V(c.value, c.initType) !== f && f !== null && U(f), T(_(c.initType));
|
|
969
|
+
}), E(i, (f) => {
|
|
970
|
+
t.value = V(f, B[p || c.initType]), U(t.value), R.value = t.value;
|
|
863
971
|
});
|
|
864
|
-
function
|
|
865
|
-
const
|
|
866
|
-
(
|
|
867
|
-
}
|
|
868
|
-
function
|
|
869
|
-
var
|
|
870
|
-
if (
|
|
871
|
-
|
|
872
|
-
const
|
|
873
|
-
elementValue:
|
|
972
|
+
function W(f) {
|
|
973
|
+
const o = document.getElementById(`farris-color-picker-plus-input-${v}`);
|
|
974
|
+
(f === "" || f === void 0 || f == null) && !l.value ? (t.value = null, o.style.borderColor = "red", H.className = "btn btn-secondary disabled") : (o.style.borderColor = "#dcdfe6", H.className = "btn btn-secondary");
|
|
975
|
+
}
|
|
976
|
+
function de(f) {
|
|
977
|
+
var o, x;
|
|
978
|
+
if (f == null || f.stopPropagation(), l.value) {
|
|
979
|
+
k.value = (t == null ? void 0 : t.value) ?? null;
|
|
980
|
+
const j = {
|
|
981
|
+
elementValue: k
|
|
874
982
|
};
|
|
875
|
-
|
|
983
|
+
e.emit("valueChanged", j), L();
|
|
876
984
|
}
|
|
877
|
-
if (!
|
|
878
|
-
(
|
|
879
|
-
const
|
|
880
|
-
elementValue:
|
|
985
|
+
if (!l.value && !(R.value === void 0 || R.value == null || R.value === "")) {
|
|
986
|
+
(x = (o = $.value) == null ? void 0 : o.style) == null || x.setProperty("background", t.value), h.value = !0, k.value = t.value;
|
|
987
|
+
const j = {
|
|
988
|
+
elementValue: k
|
|
881
989
|
};
|
|
882
|
-
|
|
990
|
+
e.emit("valueChanged", j), L();
|
|
883
991
|
}
|
|
884
|
-
!M.value && !
|
|
992
|
+
!M.value && !t.value && !h.value && l && L(), W(t.value), R.value = t.value, H.classList.contains("disabled") || (C.value = t.value, w.value = !1);
|
|
885
993
|
}
|
|
886
|
-
function
|
|
887
|
-
|
|
994
|
+
function U(f) {
|
|
995
|
+
c == null || c.setValueFrom(f, v, l.value);
|
|
888
996
|
}
|
|
889
|
-
function
|
|
890
|
-
|
|
891
|
-
const
|
|
892
|
-
r.value ||
|
|
997
|
+
function he(f) {
|
|
998
|
+
S = document.getElementById(`farris-color-picker-panel-${v}`);
|
|
999
|
+
const o = S.className === "color-picker-panel";
|
|
1000
|
+
r.value || o || (w.value = !0, S.classList.toggle("disabled"), D(), U(t.value), f.stopPropagation());
|
|
893
1001
|
}
|
|
894
|
-
function
|
|
895
|
-
|
|
1002
|
+
function L() {
|
|
1003
|
+
S = document.getElementById(`farris-color-picker-panel-${v}`), S.className = "color-picker-panel disabled";
|
|
896
1004
|
}
|
|
897
|
-
function
|
|
898
|
-
const
|
|
899
|
-
return
|
|
1005
|
+
function _(f) {
|
|
1006
|
+
const o = G.findIndex((x) => x.type === f);
|
|
1007
|
+
return P = o, o;
|
|
900
1008
|
}
|
|
901
|
-
function
|
|
902
|
-
if (!
|
|
903
|
-
const
|
|
904
|
-
|
|
1009
|
+
function z(f) {
|
|
1010
|
+
if (!H.classList.contains("disabled")) {
|
|
1011
|
+
const o = G.length;
|
|
1012
|
+
P = (o + P + (f === "up" ? 1 : -1)) % o, p = G[P].type, T(P), U(t.value);
|
|
905
1013
|
}
|
|
906
1014
|
}
|
|
907
1015
|
return () => y("div", {
|
|
908
1016
|
class: "f-color-picker-component",
|
|
909
|
-
ref:
|
|
1017
|
+
ref: F
|
|
910
1018
|
}, [y("div", {
|
|
911
1019
|
class: ["color-picker-panel", {
|
|
912
1020
|
disabled: r.value
|
|
913
1021
|
}],
|
|
914
1022
|
id: "farris-color-picker-panel",
|
|
915
|
-
ref:
|
|
916
|
-
onClick: (
|
|
1023
|
+
ref: A,
|
|
1024
|
+
onClick: (f) => f.stopPropagation(),
|
|
917
1025
|
style: "top:30px"
|
|
918
1026
|
}, [y("div", {
|
|
919
1027
|
class: "color-picker-main"
|
|
920
|
-
}, [y(
|
|
921
|
-
hue:
|
|
922
|
-
"onUpdate:hue": (
|
|
923
|
-
allowColorNull:
|
|
1028
|
+
}, [y(Pe, {
|
|
1029
|
+
hue: c.hue,
|
|
1030
|
+
"onUpdate:hue": (f) => c.hue = f,
|
|
1031
|
+
allowColorNull: l.value,
|
|
924
1032
|
color: i.value,
|
|
925
|
-
"onUpdate:color": (
|
|
926
|
-
}, null), y(
|
|
927
|
-
randomId:
|
|
928
|
-
hue:
|
|
929
|
-
"onUpdate:hue": (
|
|
930
|
-
allowColorNull:
|
|
1033
|
+
"onUpdate:color": (f) => i.value = f
|
|
1034
|
+
}, null), y(be, {
|
|
1035
|
+
randomId: v,
|
|
1036
|
+
hue: c.hue,
|
|
1037
|
+
"onUpdate:hue": (f) => c.hue = f,
|
|
1038
|
+
allowColorNull: l.value,
|
|
931
1039
|
color: i.value,
|
|
932
|
-
"onUpdate:color": (
|
|
933
|
-
}, null)]), y(
|
|
934
|
-
style:
|
|
935
|
-
randomId:
|
|
936
|
-
allowColorNull:
|
|
1040
|
+
"onUpdate:color": (f) => i.value = f
|
|
1041
|
+
}, null)]), y(Ie, {
|
|
1042
|
+
style: ne.value,
|
|
1043
|
+
randomId: v,
|
|
1044
|
+
allowColorNull: l.value,
|
|
937
1045
|
color: i.value,
|
|
938
|
-
"onUpdate:color": (
|
|
1046
|
+
"onUpdate:color": (f) => i.value = f
|
|
939
1047
|
}, null), y("div", {
|
|
940
1048
|
class: "input-btn",
|
|
941
1049
|
style: "display:flex;align-items: center;"
|
|
942
|
-
}, [
|
|
1050
|
+
}, [q(y("span", {
|
|
943
1051
|
style: "width:40px;margin-right:10px;"
|
|
944
|
-
}, [
|
|
1052
|
+
}, [d.value]), [[J, Y]]), q(y("input", {
|
|
945
1053
|
type: "text",
|
|
946
1054
|
title: "color-picker-plus",
|
|
947
1055
|
id: "farris-color-picker-plus-input",
|
|
948
|
-
"onUpdate:modelValue": (
|
|
1056
|
+
"onUpdate:modelValue": (f) => R.value = f,
|
|
949
1057
|
style: "float:none"
|
|
950
|
-
}, null), [[
|
|
1058
|
+
}, null), [[ye, R.value]]), q(y("div", {
|
|
951
1059
|
class: "type-icon-btn-wrapper",
|
|
952
1060
|
style: "cursor:pointer"
|
|
953
1061
|
}, [y("span", {
|
|
954
1062
|
class: "f-icon f-icon-arrow-60-up type-icon-btn",
|
|
955
|
-
onClick: () =>
|
|
1063
|
+
onClick: () => z("up")
|
|
956
1064
|
}, null), y("span", {
|
|
957
1065
|
class: "f-icon f-icon-arrow-60-down type-icon-btn",
|
|
958
|
-
onClick: () =>
|
|
959
|
-
}, null)]), [[
|
|
1066
|
+
onClick: () => z("down")
|
|
1067
|
+
}, null)]), [[J, Y]]), y("div", {
|
|
960
1068
|
class: "input-btn"
|
|
961
1069
|
}, [y("button", {
|
|
962
1070
|
id: "farris-color-picker-plus-sure",
|
|
963
1071
|
class: "btn btn-secondary",
|
|
964
|
-
onClick: (
|
|
965
|
-
}, [
|
|
1072
|
+
onClick: (f) => de(f)
|
|
1073
|
+
}, [fe("确定")])])]), q(y(Se, {
|
|
966
1074
|
color: i.value,
|
|
967
|
-
"onUpdate:color": (
|
|
968
|
-
hue:
|
|
969
|
-
"onUpdate:hue": (
|
|
970
|
-
randomId:
|
|
971
|
-
colorPresets:
|
|
972
|
-
}, null), [[
|
|
1075
|
+
"onUpdate:color": (f) => i.value = f,
|
|
1076
|
+
hue: c.hue,
|
|
1077
|
+
"onUpdate:hue": (f) => c.hue = f,
|
|
1078
|
+
randomId: v,
|
|
1079
|
+
colorPresets: c.presets
|
|
1080
|
+
}, null), [[J, N]])]), y("div", {
|
|
973
1081
|
class: "color-picker-wrapper"
|
|
974
1082
|
}, [y("input", {
|
|
975
1083
|
title: "color-picker-input",
|
|
976
1084
|
type: "text",
|
|
977
1085
|
class: "color-picker-input form-control",
|
|
978
|
-
value:
|
|
1086
|
+
value: C.value,
|
|
979
1087
|
readonly: r.value,
|
|
980
|
-
onClick: (
|
|
1088
|
+
onClick: (f) => f.stopPropagation()
|
|
981
1089
|
}, null), y("div", {
|
|
982
1090
|
class: "color-picker-trigger",
|
|
983
|
-
onClick:
|
|
1091
|
+
onClick: he
|
|
984
1092
|
}, [y("div", {
|
|
985
1093
|
class: "color-picker-trigger-inner"
|
|
986
1094
|
}, [y("div", {
|
|
987
|
-
style:
|
|
1095
|
+
style: re.value
|
|
988
1096
|
}, null)])])])]);
|
|
989
1097
|
}
|
|
990
|
-
}),
|
|
1098
|
+
}), Ze = /* @__PURE__ */ Z({
|
|
1099
|
+
name: "FColorPickerDesign",
|
|
1100
|
+
props: ve,
|
|
1101
|
+
emits: ["valueChanged", "activeChange", "update:color", "update:hue"],
|
|
1102
|
+
setup(u, e) {
|
|
1103
|
+
const i = b(new I(u.color)), t = b(u.color), r = b(u.disabled), k = b(u.color), l = b(u.allowColorNull), g = b(u.presets), w = b(!1), m = b(!1), h = b(!1), d = b("HEX"), v = Math.floor(Math.random() * 1e3).toString();
|
|
1104
|
+
let P = -1, p;
|
|
1105
|
+
const c = new me("#000000"), M = b(u.color);
|
|
1106
|
+
let S, H;
|
|
1107
|
+
const $ = b(null), F = b(null), A = b(), X = Be("design-item-context"), R = Re(A, X);
|
|
1108
|
+
K(() => {
|
|
1109
|
+
A.value.componentInstance = R;
|
|
1110
|
+
}), e.expose(R.value);
|
|
1111
|
+
const C = O(() => !p && c && c.initType ? c.initType : p), N = O({
|
|
1112
|
+
get() {
|
|
1113
|
+
return p && t.value !== null ? (z(p), V(new I(t.value), B[p])) : t.value;
|
|
1114
|
+
},
|
|
1115
|
+
set(o) {
|
|
1116
|
+
o !== null && (L(o), U(o));
|
|
1117
|
+
}
|
|
1118
|
+
}), Y = b(N.value), re = O(() => P > -1), ne = O(() => g.value.length > 0), G = O(() => ({
|
|
1119
|
+
"background-color": k.value
|
|
1120
|
+
})), le = O(() => m.value && w.value ? "display:flex" : "display:none"), D = [{
|
|
1121
|
+
text: "HEX",
|
|
1122
|
+
type: B.hex
|
|
1123
|
+
}, {
|
|
1124
|
+
text: "RGBA",
|
|
1125
|
+
type: B.rgba
|
|
1126
|
+
}];
|
|
1127
|
+
function ue() {
|
|
1128
|
+
const o = document.getElementById("farris-color-picker-panel");
|
|
1129
|
+
o.id = `farris-color-picker-panel-${v}`;
|
|
1130
|
+
const x = document.getElementById("farris-color-picker-plus-sure");
|
|
1131
|
+
x.id = `farris-color-picker-plus-sure-${v}`;
|
|
1132
|
+
const j = document.getElementById("farris-color-picker-plus-input");
|
|
1133
|
+
j.id = `farris-color-picker-plus-input-${v}`, H = document.getElementById(`farris-color-picker-plus-sure-${v}`), S = document.getElementById(`farris-color-picker-panel-${v}`), S.className = "color-picker-panel disabled";
|
|
1134
|
+
}
|
|
1135
|
+
function ae() {
|
|
1136
|
+
if (!l.value && !t.value) {
|
|
1137
|
+
document.getElementById(`farris-color-picker-plus-sure-${v}`).classList.toggle("disabled");
|
|
1138
|
+
const x = document.getElementById(`farris-color-picker-plus-input-${v}`);
|
|
1139
|
+
x.style.borderColor = "red";
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
function oe() {
|
|
1143
|
+
t.value && (L(t.value), !t.value && l.value || (t.value = V(new I(t.value), B[C.value])), Y.value = N.value), W(z(c.initType));
|
|
1144
|
+
}
|
|
1145
|
+
function T() {
|
|
1146
|
+
t.value && L(t.value), c.hasPresets() || c.setColorPresets(g.value), t.value ? k.value = V(new I(t.value), B[C.value]) : !t.value && l.value && (k.value = null);
|
|
1147
|
+
}
|
|
1148
|
+
function ce() {
|
|
1149
|
+
E(c.valueChanged, (o) => {
|
|
1150
|
+
const x = V(o, B[p || c.initType]);
|
|
1151
|
+
t.value = x;
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
function W(o) {
|
|
1155
|
+
d.value = D[o].text;
|
|
1156
|
+
}
|
|
1157
|
+
function de() {
|
|
1158
|
+
var o;
|
|
1159
|
+
m.value = !!(p != null && p.includes("a") || (o = c.initType) != null && o.includes("a"));
|
|
1160
|
+
}
|
|
1161
|
+
we(() => {
|
|
1162
|
+
c.setColorPresets(g.value || ["#eaecf3"]);
|
|
1163
|
+
}), K(() => {
|
|
1164
|
+
ue(), ae(), oe(), T();
|
|
1165
|
+
}), ce(), E(d, () => {
|
|
1166
|
+
N.value = V(new I(t.value), B[p || c.initType]), i.value = new I(N.value), de();
|
|
1167
|
+
}), E(t, (o) => {
|
|
1168
|
+
V(c.value, c.initType) !== o && o !== null && L(o), W(z(c.initType));
|
|
1169
|
+
}), E(i, (o) => {
|
|
1170
|
+
t.value = V(o, B[p || c.initType]), L(t.value), N.value = t.value;
|
|
1171
|
+
});
|
|
1172
|
+
function U(o) {
|
|
1173
|
+
const x = document.getElementById(`farris-color-picker-plus-input-${v}`);
|
|
1174
|
+
(o === "" || o === void 0 || o == null) && !l.value ? (t.value = null, x.style.borderColor = "red", H.className = "btn btn-secondary disabled") : (x.style.borderColor = "#dcdfe6", H.className = "btn btn-secondary");
|
|
1175
|
+
}
|
|
1176
|
+
function he() {
|
|
1177
|
+
var o, x;
|
|
1178
|
+
if (l.value) {
|
|
1179
|
+
k.value = (t == null ? void 0 : t.value) ?? null;
|
|
1180
|
+
const j = {
|
|
1181
|
+
elementValue: k
|
|
1182
|
+
};
|
|
1183
|
+
e.emit("valueChanged", j), S.classList.toggle("disabled");
|
|
1184
|
+
}
|
|
1185
|
+
if (!l.value && !(N.value === void 0 || N.value == null || N.value === "")) {
|
|
1186
|
+
(x = (o = $.value) == null ? void 0 : o.style) == null || x.setProperty("background", t.value), h.value = !0, k.value = t.value;
|
|
1187
|
+
const j = {
|
|
1188
|
+
elementValue: k
|
|
1189
|
+
};
|
|
1190
|
+
e.emit("valueChanged", j), S.classList.toggle("disabled");
|
|
1191
|
+
}
|
|
1192
|
+
!M.value && !t.value && !h.value && l && S.classList.toggle("disabled"), U(t.value), N.value = t.value, H.classList.contains("disabled") || (Y.value = t.value, w.value = !1);
|
|
1193
|
+
}
|
|
1194
|
+
function L(o) {
|
|
1195
|
+
c == null || c.setValueFrom(o, v, l.value);
|
|
1196
|
+
}
|
|
1197
|
+
function _(o) {
|
|
1198
|
+
r.value || (w.value = !0, S.classList.toggle("disabled"), ae(), L(t.value));
|
|
1199
|
+
}
|
|
1200
|
+
function z(o) {
|
|
1201
|
+
const x = D.findIndex((j) => j.type === o);
|
|
1202
|
+
return P = x, x;
|
|
1203
|
+
}
|
|
1204
|
+
function f(o) {
|
|
1205
|
+
if (!H.classList.contains("disabled")) {
|
|
1206
|
+
const x = D.length;
|
|
1207
|
+
P = (x + P + (o === "up" ? 1 : -1)) % x, p = D[P].type, W(P), L(t.value);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
return () => y("div", {
|
|
1211
|
+
class: "f-color-picker-component",
|
|
1212
|
+
ref: A
|
|
1213
|
+
}, [y("div", {
|
|
1214
|
+
class: ["color-picker-panel", {
|
|
1215
|
+
disabled: r.value
|
|
1216
|
+
}],
|
|
1217
|
+
id: "farris-color-picker-panel",
|
|
1218
|
+
ref: F,
|
|
1219
|
+
onClick: (o) => o.stopPropagation,
|
|
1220
|
+
style: "top:30px"
|
|
1221
|
+
}, [y("div", {
|
|
1222
|
+
class: "color-picker-main"
|
|
1223
|
+
}, [y(Pe, {
|
|
1224
|
+
hue: c.hue,
|
|
1225
|
+
"onUpdate:hue": (o) => c.hue = o,
|
|
1226
|
+
allowColorNull: l.value,
|
|
1227
|
+
color: i.value,
|
|
1228
|
+
"onUpdate:color": (o) => i.value = o
|
|
1229
|
+
}, null), y(be, {
|
|
1230
|
+
randomId: v,
|
|
1231
|
+
hue: c.hue,
|
|
1232
|
+
"onUpdate:hue": (o) => c.hue = o,
|
|
1233
|
+
allowColorNull: l.value,
|
|
1234
|
+
color: i.value,
|
|
1235
|
+
"onUpdate:color": (o) => i.value = o
|
|
1236
|
+
}, null)]), y(Ie, {
|
|
1237
|
+
style: le.value,
|
|
1238
|
+
randomId: v,
|
|
1239
|
+
allowColorNull: l.value,
|
|
1240
|
+
color: i.value,
|
|
1241
|
+
"onUpdate:color": (o) => i.value = o
|
|
1242
|
+
}, null), y("div", {
|
|
1243
|
+
class: "input-btn",
|
|
1244
|
+
style: "display:flex;align-items: center;"
|
|
1245
|
+
}, [q(y("span", {
|
|
1246
|
+
style: "width:40px;margin-right:10px;"
|
|
1247
|
+
}, [d.value]), [[J, ne]]), q(y("input", {
|
|
1248
|
+
title: "color-picker-plus-input",
|
|
1249
|
+
type: "text",
|
|
1250
|
+
id: "farris-color-picker-plus-input",
|
|
1251
|
+
"onUpdate:modelValue": (o) => N.value = o,
|
|
1252
|
+
style: "float:none"
|
|
1253
|
+
}, null), [[ye, N.value]]), q(y("div", {
|
|
1254
|
+
class: "type-icon-btn-wrapper",
|
|
1255
|
+
style: "cursor:pointer"
|
|
1256
|
+
}, [y("span", {
|
|
1257
|
+
class: "f-icon f-icon-arrow-60-up type-icon-btn",
|
|
1258
|
+
onClick: () => f("up")
|
|
1259
|
+
}, null), y("span", {
|
|
1260
|
+
class: "f-icon f-icon-arrow-60-down type-icon-btn",
|
|
1261
|
+
onClick: () => f("down")
|
|
1262
|
+
}, null)]), [[J, ne]]), y("div", {
|
|
1263
|
+
class: "input-btn"
|
|
1264
|
+
}, [y("button", {
|
|
1265
|
+
id: "farris-color-picker-plus-sure",
|
|
1266
|
+
class: "btn btn-secondary",
|
|
1267
|
+
onClick: he
|
|
1268
|
+
}, [fe("确定")])])]), q(y(Se, {
|
|
1269
|
+
color: i.value,
|
|
1270
|
+
"onUpdate:color": (o) => i.value = o,
|
|
1271
|
+
colorPresets: c.presets,
|
|
1272
|
+
hue: c.hue,
|
|
1273
|
+
"onUpdate:hue": (o) => c.hue = o,
|
|
1274
|
+
randomId: v
|
|
1275
|
+
}, null), [[J, re]])]), y("div", {
|
|
1276
|
+
class: "color-picker-wrapper"
|
|
1277
|
+
}, [y("input", {
|
|
1278
|
+
type: "text",
|
|
1279
|
+
class: "color-picker-input form-control",
|
|
1280
|
+
value: Y.value,
|
|
1281
|
+
readonly: r.value,
|
|
1282
|
+
onClick: (o) => o.stopPropagation()
|
|
1283
|
+
}, null), y("div", {
|
|
1284
|
+
class: "color-picker-trigger",
|
|
1285
|
+
onClick: _
|
|
1286
|
+
}, [y("div", {
|
|
1287
|
+
class: "color-picker-trigger-inner"
|
|
1288
|
+
}, [y("div", {
|
|
1289
|
+
style: G.value
|
|
1290
|
+
}, null)])])])]);
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
se.register = (u, e, i) => {
|
|
1294
|
+
u["color-picker"] = se, e["color-picker"] = ke;
|
|
1295
|
+
};
|
|
1296
|
+
se.registerDesigner = (u, e, i) => {
|
|
1297
|
+
u["color-picker"] = Ze, e["color-picker"] = ke;
|
|
1298
|
+
};
|
|
1299
|
+
const at = Ve(se);
|
|
991
1300
|
export {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1301
|
+
se as FColorPicker,
|
|
1302
|
+
ve as colorPickerProps,
|
|
1303
|
+
at as default,
|
|
1304
|
+
ke as propsResolver
|
|
995
1305
|
};
|