@farris/ui-vue 1.2.9 → 1.3.1
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 +64 -64
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +521 -336
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +99 -97
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +496 -504
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +251 -259
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +696 -519
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +368 -376
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1141 -340
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +116 -116
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +986 -798
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +463 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2233 -1057
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +335 -1002
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6193 -4702
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4562 -3294
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3420 -2623
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +914 -883
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +204 -212
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2795 -1835
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +180 -130
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +328 -336
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3349 -3626
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5344 -8588
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +2179 -2227
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +684 -675
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +482 -490
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +746 -569
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +409 -385
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +348 -1019
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3606 -2388
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10871 -8970
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +6019 -5631
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +912 -1281
- package/components/nav/index.umd.cjs +3 -3
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +660 -484
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +682 -506
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1848 -1658
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1120 -1923
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +875 -1214
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +229 -237
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +2314 -1521
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +867 -868
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +4332 -3623
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +613 -437
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +255 -263
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +144 -152
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1101 -1038
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +935 -1750
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +5264 -5677
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +151 -154
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +438 -1125
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +93 -101
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +563 -1202
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +248 -256
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +549 -373
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +2436 -3110
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +328 -336
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +339 -347
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +554 -378
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1322 -1144
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +537 -543
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5113 -9426
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3900 -2677
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +568 -570
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +266 -274
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +553 -1052
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +558 -566
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +22009 -22688
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/directive/area-response.d.ts +10 -0
- package/types/common/index.d.ts +9 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/condition/src/types.d.ts +2 -1
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +11 -5
- package/types/data-grid/src/data-grid.component.d.ts +4 -2
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +19 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +2 -3
- package/types/designer-canvas/src/types.d.ts +2 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +1 -1
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/index.d.ts +2 -0
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/{data-grid/src/designer/use-group-column.d.ts → query-solution/src/designer/query-solution-config/composition/use-property.d.ts} +4 -5
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`+
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function ee(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var H=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,r,o,a;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var y=I(l),g=y.next();!g.done;g=y.next()){var u=g.value;u.remove(this)}}catch(i){t={error:i}}finally{try{g&&!g.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else l.remove(this);var p=this.initialTeardown;if(O(p))try{p()}catch(i){a=i instanceof z?i.errors:[i]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=I(f),C=h.next();!C.done;C=h.next()){var c=C.value;try{ne(c)}catch(i){a=a??[],i instanceof z?a=U(U([],W(a)),W(i.errors)):a.push(i)}}}catch(i){r={error:i}}finally{try{C&&!C.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}}if(a)throw new z(a)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)ne(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&ee(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&ee(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}();H.EMPTY;function te(n){return n instanceof H||n&&"closed"in n&&O(n.remove)&&O(n.add)&&O(n.unsubscribe)}function ne(n){O(n)?n():n.unsubscribe()}var re={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},de={setTimeout:function(n,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];return setTimeout.apply(void 0,U([n,t],W(e)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function ye(n){de.setTimeout(function(){throw n})}function oe(){}function be(n){n()}var ae=function(n){K(t,n);function t(e){var r=n.call(this)||this;return r.isStopped=!1,e?(r.destination=e,te(e)&&e.add(r)):r.destination=ge,r}return t.create=function(e,r,o){return new G(e,r,o)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(H),he=Function.prototype.bind;function Y(n,t){return he.call(n,t)}var me=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){F(r)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){F(r)}else F(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){F(e)}},n}(),G=function(n){K(t,n);function t(e,r,o){var a=n.call(this)||this,l;if(O(e)||!e)l={next:e??void 0,error:r??void 0,complete:o??void 0};else{var y;a&&re.useDeprecatedNextContext?(y=Object.create(e),y.unsubscribe=function(){return a.unsubscribe()},l={next:e.next&&Y(e.next,y),error:e.error&&Y(e.error,y),complete:e.complete&&Y(e.complete,y)}):l=e}return a.destination=new me(l),a}return t}(ae);function F(n){ye(n)}function ve(n){throw n}var ge={closed:!0,next:oe,error:ve,complete:oe},je=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ce(n){return n}function Pe(n){return n.length===0?Ce:n.length===1?n[0]:function(e){return n.reduce(function(r,o){return o(r)},e)}}var Te=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,r){var o=this,a=Ne(t)?t:new G(t,e,r);return be(function(){var l=o,y=l.operator,g=l.source;a.add(y?y.call(a,g):g?o._subscribe(a):o._trySubscribe(a))}),a},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var r=this;return e=ie(e),new e(function(o,a){var l=new G({next:function(y){try{t(y)}catch(g){a(g),l.unsubscribe()}},error:a,complete:o});r.subscribe(l)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[je]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Pe(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=ie(t),new t(function(r,o){var a;e.subscribe(function(l){return a=l},function(l){return o(l)},function(){return r(a)})})},n.create=function(t){return new n(t)},n}();function ie(n){var t;return(t=n??re.Promise)!==null&&t!==void 0?t:Promise}function Ae(n){return n&&O(n.next)&&O(n.error)&&O(n.complete)}function Ne(n){return n&&n instanceof ae||Ae(n)&&te(n)}const ce={},se={};function J(n){const{properties:t,title:e,ignore:r}=n,o=r&&Array.isArray(r),a=Object.keys(t).reduce((l,y)=>((!o||!r.find(g=>g==y))&&(l[y]=t[y].type==="object"&&t[y].properties?J(t[y]):ue.cloneDeep(t[y].default)),l),{});return(!o||!r.find(l=>l=="id"))&&(a.id=`${e}-${Date.now()}`),a}function V(n,t={},e){const r=ce[n];if(r){let o=J(r);const a=se[n];return o=a?a({getSchemaByType:V},o,t,e):o,o}return null}function Se(n,t){const e=J(t);return Object.keys(n).reduce((r,o)=>(r[o]&&typeof r[o]=="object"?Object.assign(r[o],n[o]):r[o]=n[o],r),e),e}function Ee(n,t){return Object.keys(n).filter(r=>n[r]!=null).reduce((r,o)=>{if(t.has(o)){const a=t.get(o);if(typeof a=="string")r[a]=n[o];else{const l=a(o,n[o],n);Object.assign(r,l)}}else r[o]=n[o];return r},{})}function De(n,t,e=new Map){const r=Se(n,t);return Ee(r,e)}function we(n={}){function t(u,p,f,h){if(typeof f=="number")return h[u].length===f;if(typeof f=="object"){const C=Object.keys(f)[0],c=f[C];if(C==="not")return Number(h[u].length)!==Number(c);if(C==="moreThan")return Number(h[u].length)>=Number(c);if(C==="lessThan")return Number(h[u].length)<=Number(c)}return!1}function e(u,p,f,h){return h[u]&&h[u].propertyValue&&String(h[u].propertyValue.value)===String(f)}const r=new Map([["length",t],["getProperty",e]]);Object.keys(n).reduce((u,p)=>(u.set(p,n[p]),u),r);function o(u,p){const f=u;return typeof p=="number"?[{target:f,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:f,operator:"getProperty",param:u,value:!!p}]:typeof p=="object"?Object.keys(p).map(h=>{if(h==="length")return{target:f,operator:"length",param:null,value:p[h]};const C=h,c=p[h];return{target:f,operator:"getProperty",param:C,value:c}}):[]}function a(u){return Object.keys(u).reduce((f,h)=>{const C=o(h,u[h]);return f.push(...C),f},[])}function l(u,p){if(r.has(u.operator)){const f=r.get(u.operator);return f&&f(u.target,u.param,u.value,p)||!1}return!1}function y(u,p){return a(u).reduce((C,c)=>C&&l(c,p),!0)}function g(u,p){const f=Object.keys(u),h=f.includes("allOf"),C=f.includes("anyOf"),c=h||C,m=(c?u[c?h?"allOf":"anyOf":"allOf"]:[u]).map(P=>y(P,p));return h?!m.includes(!1):m.includes(!0)}return{parseValueSchema:g}}const Oe={},ke={};we();function Me(n,t,e=new Map,r=(l,y,g)=>y,o={},a=l=>l){return ce[t.title]=t,se[t.title]=r,Oe[t.title]=o,ke[t.title]=a,(l={})=>{const y=De(l,t,e),g=Object.keys(n).reduce((u,p)=>(u[p]=n[p].default,u),{});return Object.assign(g,y)}}function $e(n,t){return{customClass:t.class,customStyle:t.style}}const Ve=new Map([["appearance",$e]]),_e={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/nav.schema.json",title:"nav",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a nav",type:"string"},type:{description:"The type string of nav component",type:"string",default:"nav"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]};function Fe(n,t,e){return t}const Le={title:"nav",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中对齐"},{value:"right",name:"右对齐"}]}}}}}},L={maxNum:{Type:Number,default:99},navData:{Type:Array,default:[{id:"1",text:"全部"},{id:"2",text:"已回复",disable:!0},{id:"3",text:"待回复",num:200},{id:"4",text:"@我",num:33}]},horizontal:{Type:Boolean,default:!0},activeNavId:{Type:String,default:"1"},navPicking:{Type:Function,default:n=>Te}},Q=Me(L,_e,Ve,Fe,Le),x=d.defineComponent({name:"FNav",props:L,emits:["nav","update:activeNavId"],setup(n,t){const e=d.ref(n.activeNavId),r=d.ref(n.navData),o=d.ref(n.horizontal);d.ref(n.navPicking),d.watch(()=>n.activeNavId,(p,f)=>{p!==f&&(e.value=p)});const a=d.computed({get(){return r.value},set(p){r.value=p,g()}}),l=d.computed({get(){return e.value},set(p){if(e.value=p,e.value&&a&&a.value.length){const f=a.value.find(h=>h.id===e.value);f&&t.emit("nav",f)}}}),y=d.computed({set(p){o.value=p},get(){return o.value}});function g(){if(a.value&&a.value.length&&!e.value){const p=a.value.find(f=>!f.disable);p&&(e.value=p.id)}}function u(p){p.disable||p.id===e.value||(e.value=p.id,t.emit("update:activeNavId",p.id),t.emit("nav",p))}return()=>{var p;return d.createVNode("div",{class:["farris-nav",{"farris-nav-vertical":!y.value}]},[(p=a.value)==null?void 0:p.map(f=>d.createVNode("div",{class:["farris-nav-item",{active:f.id===l.value},{disabled:f.disable}],onClick:()=>u(f)},[d.createVNode("div",{class:"farris-nav-item-link"},[d.createVNode("span",{class:"farris-nav-item-link-text"},[typeof f.text=="function"?f.text():f.text,f.num&&d.createVNode("div",{class:"farris-nav-item-tag"},[f.num<=n.maxNum&&d.createVNode("span",{class:"tag-text"},[f.num]),f.num>n.maxNum&&d.createVNode("span",{class:"tag-text"},[n.maxNum,d.createTextVNode("+")])])])])]))])}}});function xe(n,t,e){var M;function r(){e!=null&&e.resolveComponentContext&&e.resolveComponentContext()}r();const o=e&&e.getStyles&&e.getStyles()||"",a=e&&e.getDesignerClass&&e.getDesignerClass()||"",l=d.ref();function y(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanMoveComponent?e.checkCanMoveComponent():!0}function g(){return!1}function u(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanDeleteComponent?e.checkCanDeleteComponent():!0}function p(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:e&&e.hideNestedPaddingInDesginerView?e.hideNestedPaddingInDesginerView():!1}function f(v){if(!v||!v.value)return null;if(v.value.schema&&v.value.schema.type==="component")return v.value;const N=d.ref(v==null?void 0:v.value.parent),b=f(N);return b||null}function h(v=t){const{componentInstance:N,designerItemElementRef:b}=v;return!N||!N.value?null:N.value.canMove?b:h(v.parent)}function C(v){return!!e&&e.canAccepts(v)}function c(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function i(){}function s(v,N){N&&e!=null&&e.onAcceptMovedChildElement&&e.onAcceptMovedChildElement(N)}function m(v,N){const{componentType:b}=v;let j=V(b,v,N);e&&e.onResolveNewComponentSchema&&(j=e.onResolveNewComponentSchema(v,j));const S=b.toLowerCase().replace("-","_");return j&&!j.id&&j.type===b&&(j.id=`${S}_${Math.random().toString().slice(2,6)}`),j}function A(v,N){const b=String(v.getAttribute("data-controltype")),j=v.getAttribute("data-feature"),S=j?JSON.parse(j):{};S.parentComponentInstance=l.value;let T=V(b,S);e&&e.onAcceptNewChildElement&&(T=e.onAcceptNewChildElement(v,N,T));const k=b.toLowerCase().replace("-","_");return T&&!T.id&&T.type===b&&(T.id=`${k}_${Math.random().toString().slice(2,6)}`),T}function P(v){}function E(...v){if(e&&e.getPropsConfig)return e.getPropsConfig(...v)}return l.value={canMove:y(),canSelectParent:g(),canDelete:u(),canNested:!p(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(M=t==null?void 0:t.parent)==null?void 0:M.componentInstance,schema:t==null?void 0:t.schema,styles:o,designerClass:a,canAccepts:C,getBelongedComponentInstance:f,getDraggableDesignItemElement:h,getDraggingDisplayText:c,getPropConfig:E,getDragScopeElement:i,onAcceptMovedChildElement:s,onAcceptNewChildElement:A,onChildElementMovedOut:P,addNewChildComponentSchema:m,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!e&&e.triggerBelongedComponentToMoveWhenMoved||d.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!e&&e.triggerBelongedComponentToDeleteWhenDeleted||d.ref(!1)},l}function Be(){function n(t){var o,a;if(!t)return!1;const e=((o=t.targetContainer)==null?void 0:o.componentInstance)&&t.targetContainer.componentInstance.value;if(!e)return!1;const r=(a=e.schema.appearance)==null?void 0:a.class;if(t.controlCategory==="input"||t.controlType==="form-group"){const l=e.schema.type,y=(l==="response-form"||l==="content-container")&&r&&r.includes("farris-form");if(e.schema.type!=="response-layout-item"&&!y)return!1}return t.controlType!=="field-set"}return{basalDragulaRuleForContainer:n}}const qe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dragging-rules.schema.json",title:"Dragging Rules",description:"The rules of designer canvas",type:"object",properties:{"f-page":{description:"The root class of page designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-page-header":{description:"The class of page header designed by farris.",type:"string"},"f-page-main":{description:"The class of page body designed by farris.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-like-card":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-form":{description:"The class of form component which has a hierarchical structure of component -> section -> respnse-form.",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{contents:{type:"object",properties:{"f-form-layout":{description:"The class of reponse form",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}},"f-struct-wrapper":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-tabs":{description:"The class of section which has wrapped sub-grid tabs.",type:"object",properties:{contents:{type:"object",properties:{"f-tabs-in-card":{description:"The class of tabs which contains sub-grid.",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-card":{description:"The class of sub-grid component",type:"object",properties:{contents:{type:"object",properties:{"f-grid-is-sub":{description:"The class of sub-grid",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-in-main":{description:"The class of section which has wrapped a reponse-form component.",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"object",const:{allOf:[{sibling:0,parent:{"f-page-main":!0}}]}}}}}},"f-struct-data-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"object",const:!0},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-main-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav-extend":{description:"",type:"object"},"f-section-in-nav":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!1}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!0},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}}}},"f-page-content-main":{description:"",type:"object",properties:{}}}}}},"f-page-content":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-page-content-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-list-nav":{description:"",type:"object"},"f-list-nav-left":{description:"",type:"object"},"f-struct-data-grid-in-nav":{description:"",type:"object",properties:{contents:{type:"object",properties:{"f-section-form":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-section-grid":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}},"f-page-content-main":{description:"",type:"object",properties:{rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!1},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}}}},rules:{type:"object",properties:{canAccept:{type:"object",const:{anyOf:[{children:0},{children:{length:{not:1},"f-struct-like-card":!0}},{children:{"scroll-spy":!1,"f-page-content":!1,"f-struct-like-card":!1}}]}},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-footer":{description:"The class of page footer designed by farris.",type:"string"}}},rules:{type:"object",properties:{canAccept:{type:"boolean",const:!1},fixed:{type:"boolean",const:!0},hidePadding:{type:"boolean",const:!0}}}}},"f-page-is-managelist":{description:"The root class of mangement list page.",type:"string"},"f-page-card":{description:"",type:"object"},"f-page-is-mainsubcard":{description:"",type:"object"}}},X=new Map;function We(){function n(c,i,s,m){var A;if(typeof s=="number")return((A=m[c])==null?void 0:A.length)===s;if(typeof s=="object"){const P=Object.keys(s)[0],E=s[P];if(P==="not")return Number(m[c].length)!==Number(E);if(P==="moreThan")return Number(m[c].length)>=Number(E);if(P==="lessThan")return Number(m[c].length)<=Number(E)}return!1}function t(c,i,s,m){return typeof s=="boolean"?m.childrenClassList.includes(i)===!!s:!1}function e(c,i,s,m){return typeof s=="boolean"?m.parentClassList.includes(i)===!!s:!1}function r(c,i,s,m){return typeof s=="boolean"?m.parentClassList.includes(i)===!!s:!1}const o=new Map([["length",n],["hasChildren",t],["hasSibling",r],["hasParent",e]]);function a(c,i){const s=c;return typeof i=="number"?[{target:s,operator:"length",param:null,value:Number(i)}]:typeof i=="object"?Object.keys(i).map(m=>{if(m==="length")return{target:s,operator:"length",param:null,value:i[m]};const A=m,P=i[m];return{target:s,operator:c==="children"?"hasChildren":c==="parent"?"hasParent":"hasSibling",param:A,value:P}}):[]}function l(c,i){if(o.has(c.operator)){const s=o.get(c.operator);return s&&s(c.target,c.param,c.value,i)||!1}return!1}function y(c,i){return Object.keys(c).reduce((P,E)=>{const M=a(E,c[E]);return P.push(...M),P},[]).reduce((P,E)=>P&&l(E,i),!0)}function g(c,i){const s=Object.keys(c),m=s.includes("allOf"),A=s.includes("anyOf"),P=m||A,v=(P?c[P?m?"allOf":"anyOf":"allOf"]:[c]).map(b=>y(b,i));return m?!v.includes(!1):v.includes(!0)}function u(c,i){const s=c.const;return s?typeof s=="boolean"?s:typeof s=="object"?g(s,i):!1:!1}function p(c){return i=>{const s={canAccept:!0,fixed:!1,hidePadding:!1};return c&&c.properties&&Object.keys(c.properties).reduce((m,A)=>{const P=c.properties[A];return m[A]=u(P,i),m},s),s}}function f(c,i,s){if(i.type==="object"&&i.properties){const{rules:m,contents:A}=i.properties;s.set(c,p(m)),A&&Object.keys(A.properties).forEach(P=>f(P,A.properties[P],s))}}function h(){const{properties:c}=qe;Object.keys(c).forEach(i=>{f(i,c[i],X)})}function C(c,i){const s={canAccept:!0,fixed:!1,hidePadding:!0};return X.has(c)?X.get(c)(i):s}return h(),{getRuleValue:C}}function Ue(n,t){var N;const e=n.schema,r=(N=n.parent)==null?void 0:N.schema,o=We(),a=d.ref(!1),l=d.ref(!1);let y=!0,g=!1,u,p=!1;function f(b){return u&&u.componentClassList&&u.componentClassList.includes("f-form-layout")&&u.componentClassList.includes("farris-form")?b.sourceType==="control"&&b.controlCategory==="input"||b.sourceType==="move"&&b.controlType==="form-group":!0}function h(b){return!(!Be().basalDragulaRuleForContainer(b)||!y||!f(b))}function C(){a.value=!1,l.value=!1;const b=e,j=b.appearance&&b.appearance.class||"",S=j.split(" "),T=b.contents||[],k=T.length?T[0]:null,$=k&&k.appearance?k.appearance.class:"",D=$?$.split(" "):[],_=T.length?T.reduce((pe,R)=>{const le=R&&R.appearance?R.appearance.class:"",Xe=le?le.split(" "):[];return pe.push(...Xe),pe},[]):[],B=r,Z=B&&B.appearance&&B.appearance.class||"",Ye=Z?Z.split(" "):[];u={componentClass:j,componentClassList:S,childContents:T,firstChildContent:k,firstChildClass:$,firstChildClassList:D,parent:B,parentClass:Z,parentClassList:Ye,children:T,childrenClassList:_};const{canAccept:Ge,fixed:Je,hidePadding:Qe}=o.getRuleValue(S[0],u);return y=Ge,g=Qe,p=Je,!0}function c(b){d.nextTick()}function i(){return e.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function s(b,j){const S=e;if((S.appearance&&S.appearance.class||"").split(" ").includes("f-form-layout")){const{label:$}=b,D=V("form-group");return D.editor=j,D.label=$,m(D),delete D.editor.id,delete D.editor.binding,delete D.editor.appearance,delete D.editor.visible,D}return j}function m(b){const j=n.componentInstance.value.getBelongedComponentInstance(n.componentInstance);if(j&&j.schema&&j.schema.componentType){const S=j.schema.formColumns,T=A(S);b.appearance||(b.appearance={}),b.appearance.class=T}}function A(b){let j="";switch(b){case 1:{j="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{j="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{j="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{j="col-12 col-md-6 col-xl-3 col-el-2";break}}return j}function P(b,j,S){const T=e;if((T.appearance&&T.appearance.class||"").split(" ").includes("f-form-layout")){const D=String(b.innerText),_=V("form-group");return _.editor=S,_.label=D,_}return S}function E(){return!p}function M(){return!p}function v(){return g}return{canAccepts:h,checkCanDeleteComponent:M,checkCanMoveComponent:E,getStyles:i,hideNestedPaddingInDesginerView:v,onAcceptNewChildElement:P,onAcceptMovedChildElement:c,resolveComponentContext:C,onResolveNewComponentSchema:s,triggerBelongedComponentToMoveWhenMoved:a,triggerBelongedComponentToDeleteWhenDeleted:l}}const ze=d.defineComponent({name:"FNavDesign",props:L,emits:["nav"],setup(n,t){var c;const e=d.ref(n.activeNavId),r=d.ref(n.navData),o=d.ref(n.horizontal);d.ref(n.navPicking);const a=d.ref(),l=d.inject("design-item-context"),y=Ue(l.schema,(c=l.parent)==null?void 0:c.schema),g=xe(a,l,y);d.onMounted(()=>{a.value.componentInstance=g}),t.expose(g.value);const u=d.computed({get(){return r.value},set(i){r.value=i,h()}}),p=d.computed({get(){return e.value},set(i){if(e.value=i,e.value&&u&&u.value.length){const s=u.value.find(m=>m.id===e.value);s&&t.emit("nav",s)}}}),f=d.computed({set(i){o.value=i},get(){return o.value}});function h(){if(u.value&&u.value.length&&!e.value){const i=u.value.find(s=>!s.disable);i&&(e.value=i.id)}}function C(i){i.disable||i.id===e.value||(e.value=i.id,t.emit("nav",i))}return()=>{var i;return d.createVNode("div",{ref:a,class:["farris-nav",{"farris-nav-vertical":!f.value}]},[(i=u.value)==null?void 0:i.map(s=>d.createVNode("div",{class:["farris-nav-item",{active:s.id===p.value},{disabled:s.disable}],onClick:()=>C(s)},[d.createVNode("div",{class:"farris-nav-item-link"},[d.createVNode("span",{class:"farris-nav-item-link-text"},[s.text,s.num&&d.createVNode("div",{class:"farris-nav-item-tag"},[s.num<=n.maxNum&&d.createVNode("span",{class:"tag-text"},[s.num]),s.num>n.maxNum&&d.createVNode("span",{class:"tag-text"},[n.maxNum,d.createTextVNode("+")])])])])]))])}}}),He={install(n){n.component(x.name,x)},register(n,t,e,r){n.nav=x,t.nav=Q},registerDesigner(n,t,e){n.nav=ze,t.nav=Q}};w.FNav=x,w.default=He,w.navProps=L,w.propsResolver=Q,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(L,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("vue"),require("lodash-es"),require("../designer-canvas/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../designer-canvas/index.umd.js"],m):(L=typeof globalThis<"u"?globalThis:L||self,m(L.nav={},L.Vue,L.LodashES,L.designerCanvas))})(this,function(L,m,I,V){"use strict";var We=Object.defineProperty;var qe=(L,m,I)=>m in L?We(L,m,{enumerable:!0,configurable:!0,writable:!0,value:I}):L[m]=I;var S=(L,m,I)=>qe(L,typeof m!="symbol"?m+"":m,I);var B=function(n,e){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},B(n,e)};function Y(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");B(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function J(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),a,i=[],s;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)i.push(a.value)}catch(f){s={error:f}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return i}function _(n,e,t){if(t||arguments.length===2)for(var r=0,a=e.length,i;r<a;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return n.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function N(n){return typeof n=="function"}function re(n){var e=function(r){Error.call(r),r.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var j=re(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
2
|
+
`+t.map(function(r,a){return a+1+") "+r.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Q(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var O=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,r,a,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var f=J(s),d=f.next();!d.done;d=f.next()){var c=d.value;c.remove(this)}}catch(u){e={error:u}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else s.remove(this);var l=this.initialTeardown;if(N(l))try{l()}catch(u){i=u instanceof j?u.errors:[u]}var o=this._finalizers;if(o){this._finalizers=null;try{for(var p=J(o),h=p.next();!h.done;h=p.next()){var v=h.value;try{x(v)}catch(u){i=i??[],u instanceof j?i=_(_([],U(i)),U(u.errors)):i.push(u)}}}catch(u){r={error:u}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}}if(i)throw new j(i)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)x(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Q(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&Q(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}();O.EMPTY;function Z(n){return n instanceof O||n&&"closed"in n&&N(n.remove)&&N(n.add)&&N(n.unsubscribe)}function x(n){N(n)?n():n.unsubscribe()}var R={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},oe={setTimeout:function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return setTimeout.apply(void 0,_([n,e],U(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function ie(n){oe.setTimeout(function(){throw n})}function K(){}function ae(n){n()}var H=function(n){Y(e,n);function e(t){var r=n.call(this)||this;return r.isStopped=!1,t?(r.destination=t,Z(t)&&t.add(r)):r.destination=ue,r}return e.create=function(t,r,a){return new W(t,r,a)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(O),se=Function.prototype.bind;function $(n,e){return se.call(n,e)}var ce=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(r){k(r)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(r){k(r)}else k(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){k(t)}},n}(),W=function(n){Y(e,n);function e(t,r,a){var i=n.call(this)||this,s;if(N(t)||!t)s={next:t??void 0,error:r??void 0,complete:a??void 0};else{var f;i&&R.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&$(t.next,f),error:t.error&&$(t.error,f),complete:t.complete&&$(t.complete,f)}):s=t}return i.destination=new ce(s),i}return e}(H);function k(n){ie(n)}function le(n){throw n}var ue={closed:!0,next:K,error:le,complete:K},pe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function fe(n){return n}function de(n){return n.length===0?fe:n.length===1?n[0]:function(t){return n.reduce(function(r,a){return a(r)},t)}}var me=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,r){var a=this,i=ye(e)?e:new W(e,t,r);return ae(function(){var s=a,f=s.operator,d=s.source;i.add(f?f.call(i,d):d?a._subscribe(i):a._trySubscribe(i))}),i},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var r=this;return t=ee(t),new t(function(a,i){var s=new W({next:function(f){try{e(f)}catch(d){i(d),s.unsubscribe()}},error:i,complete:a});r.subscribe(s)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[pe]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return de(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=ee(e),new e(function(r,a){var i;t.subscribe(function(s){return i=s},function(s){return a(s)},function(){return r(i)})})},n.create=function(e){return new n(e)},n}();function ee(n){var e;return(e=n??R.Promise)!==null&&e!==void 0?e:Promise}function he(n){return n&&N(n.next)&&N(n.error)&&N(n.complete)}function ye(n){return n&&n instanceof H||he(n)&&Z(n)}const te={},ne={};function q(n){const{properties:e,title:t,ignore:r}=n,a=r&&Array.isArray(r),i=Object.keys(e).reduce((s,f)=>((!a||!r.find(d=>d==f))&&(s[f]=e[f].type==="object"&&e[f].properties?q(e[f]):I.cloneDeep(e[f].default)),s),{});return t&&(!a||!r.find(s=>s=="id"))&&(i.id=`${t}-${Date.now()}`),i}function G(n,e={},t){const r=te[n];if(r){let a=q(r);const i=ne[n];return a=i?i({getSchemaByType:G},a,e,t):a,a}return null}function ve(n,e){const t=q(e);return Object.keys(n).reduce((r,a)=>(r[a]&&I.isPlainObject(r[a])&&I.isPlainObject(n[a])?Object.assign(r[a],n[a]):r[a]=n[a],r),t),t}function be(n,e){return Object.keys(n).filter(r=>n[r]!=null).reduce((r,a)=>{if(e.has(a)){const i=e.get(a);if(typeof i=="string")r[i]=n[a];else{const s=i(a,n[a],n);Object.assign(r,s)}}else r[a]=n[a];return r},{})}function Ce(n,e,t=new Map){const r=ve(n,e);return be(r,t)}function ge(n={}){function e(c,l,o,p){if(typeof o=="number")return p[c].length===o;if(typeof o=="object"){const h=Object.keys(o)[0],v=o[h];if(h==="not")return Number(p[c].length)!==Number(v);if(h==="moreThan")return Number(p[c].length)>=Number(v);if(h==="lessThan")return Number(p[c].length)<=Number(v)}return!1}function t(c,l,o,p){return p[c]&&p[c].propertyValue&&String(p[c].propertyValue.value)===String(o)}const r=new Map([["length",e],["getProperty",t]]);Object.keys(n).reduce((c,l)=>(c.set(l,n[l]),c),r);function a(c,l){const o=c;return typeof l=="number"?[{target:o,operator:"length",param:null,value:Number(l)}]:typeof l=="boolean"?[{target:o,operator:"getProperty",param:c,value:!!l}]:typeof l=="object"?Object.keys(l).map(p=>{if(p==="length")return{target:o,operator:"length",param:null,value:l[p]};const h=p,v=l[p];return{target:o,operator:"getProperty",param:h,value:v}}):[]}function i(c){return Object.keys(c).reduce((o,p)=>{const h=a(p,c[p]);return o.push(...h),o},[])}function s(c,l){if(r.has(c.operator)){const o=r.get(c.operator);return o&&o(c.target,c.param,c.value,l)||!1}return!1}function f(c,l){return i(c).reduce((h,v)=>h&&s(v,l),!0)}function d(c,l){const o=Object.keys(c),p=o.includes("allOf"),h=o.includes("anyOf"),v=p||h,g=(v?c[v?p?"allOf":"anyOf":"allOf"]:[c]).map(M=>f(M,l));return p?!g.includes(!1):g.includes(!0)}return{parseValueSchema:d}}const P={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"}},Me={},Se={};ge();function De(n,e,t=new Map,r=(s,f,d)=>f,a={},i=s=>s){return te[e.title]=e,ne[e.title]=r,Me[e.title]=a,Se[e.title]=i,(s={})=>{const f=Ce(s,e,t),d=Object.keys(n).reduce((c,l)=>(c[l]=n[l].default,c),{});return Object.assign(d,f)}}function Te(n,e){return{customClass:e.class,customStyle:e.style}}const Le=new Map([["appearance",Te]]),Ee={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/nav.schema.json",title:"nav",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a nav",type:"string"},type:{description:"The type string of nav component",type:"string",default:"nav"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},editable:{description:"",type:"boolean",default:!0},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""}},required:["id","type"]};function we(n,e,t){return e}const Ie={title:"nav",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{editable:{description:"",title:"允许编辑",type:"boolean"},readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"},textAlign:{description:"",title:"对齐方式",type:"enum",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:"left",name:"左对齐"},{value:"center",name:"居中对齐"},{value:"right",name:"右对齐"}]}}}}}},F={maxNum:{Type:Number,default:99},navData:{Type:Array,default:[{id:"1",text:"全部"},{id:"2",text:"已回复",disable:!0},{id:"3",text:"待回复",num:200},{id:"4",text:"@我",num:33}]},horizontal:{Type:Boolean,default:!0},activeNavId:{Type:String,default:"1"},navPicking:{Type:Function,default:n=>me}},z=De(F,Ee,Le,we,Ie),A=m.defineComponent({name:"FNav",props:F,emits:["nav","update:activeNavId"],setup(n,e){const t=m.ref(n.activeNavId),r=m.ref(n.navData),a=m.ref(n.horizontal);m.ref(n.navPicking),m.watch(()=>n.activeNavId,(l,o)=>{l!==o&&(t.value=l)});const i=m.computed({get(){return r.value},set(l){r.value=l,d()}}),s=m.computed({get(){return t.value},set(l){if(t.value=l,t.value&&i&&i.value.length){const o=i.value.find(p=>p.id===t.value);o&&e.emit("nav",o)}}}),f=m.computed({set(l){a.value=l},get(){return a.value}});function d(){if(i.value&&i.value.length&&!t.value){const l=i.value.find(o=>!o.disable);l&&(t.value=l.id)}}function c(l){l.disable||l.id===t.value||(t.value=l.id,e.emit("update:activeNavId",l.id),e.emit("nav",l))}return()=>{var l;return m.createVNode("div",{class:["farris-nav",{"farris-nav-vertical":!f.value}]},[(l=i.value)==null?void 0:l.map(o=>m.createVNode("div",{class:["farris-nav-item",{active:o.id===s.value},{disabled:o.disable}],onClick:()=>c(o)},[m.createVNode("div",{class:"farris-nav-item-link"},[m.createVNode("span",{class:"farris-nav-item-link-text"},[typeof o.text=="function"?o.text():o.text,o.num&&m.createVNode("div",{class:"farris-nav-item-tag"},[o.num<=n.maxNum&&m.createVNode("span",{class:"tag-text"},[o.num]),o.num>n.maxNum&&m.createVNode("span",{class:"tag-text"},[n.maxNum,m.createTextVNode("+")])])])])]))])}}});function Ne(n,e,t){var T;function r(){t!=null&&t.resolveComponentContext&&t.resolveComponentContext()}r();const a=t&&t.getStyles&&t.getStyles()||"",i=t&&t.getDesignerClass&&t.getDesignerClass()||"",s=m.ref();function f(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function d(){return!1}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function l(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function o(C){if(!C||!C.value)return null;if(C.value.schema&&C.value.schema.type==="component")return C.value;const D=m.ref(C==null?void 0:C.value.parent),w=o(D);return w||null}function p(C=e){const{componentInstance:D,designerItemElementRef:w}=C;return!D||!D.value?null:D.value.canMove?w:p(C.parent)}function h(C){return!!t&&t.canAccepts(C)}function v(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function u(){}function b(C,D){D&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(D)}function g(C,D){const{componentType:w}=C;let E=G(w,C,D);t&&t.onResolveNewComponentSchema&&(E=t.onResolveNewComponentSchema(C,E));const X=w.toLowerCase().replace("-","_");return E&&!E.id&&E.type===w&&(E.id=`${X}_${Math.random().toString().slice(2,6)}`),E}function y(C){}function M(...C){if(t&&t.getPropsConfig)return t.getPropsConfig(...C)}return s.value={canMove:f(),canSelectParent:d(),canDelete:c(),canNested:!l(),contents:e==null?void 0:e.schema.contents,elementRef:n,parent:(T=e==null?void 0:e.parent)==null?void 0:T.componentInstance,schema:e==null?void 0:e.schema,styles:a,designerClass:i,canAccepts:h,getBelongedComponentInstance:o,getDraggableDesignItemElement:p,getDraggingDisplayText:v,getPropConfig:M,getDragScopeElement:u,onAcceptMovedChildElement:b,onChildElementMovedOut:y,addNewChildComponentSchema:g,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||m.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||m.ref(!1)},s}function Pe(){function n(e,t){var s;if(!e)return!1;const r=((s=e.targetContainer)==null?void 0:s.componentInstance)&&e.targetContainer.componentInstance.value;if(!r)return!1;const a=r.schema.type,i=t==null?void 0:t.formSchemaUtils.getComponentById(r.belongedComponentId);return!((e.controlCategory==="input"||e.controlType==="form-group")&&![P["response-layout-item"].type,P["response-form"].type].includes(a)||(e.controlType===P.tabs.type||e.controlType===P.section.type)&&((i==null?void 0:i.componentType)!=="frame"||![P["content-container"].type,P["splitter-pane"].type,P["response-layout-item"].type].includes(a)))}return{basalDragulaRuleForContainer:n}}class ke{getTemplateRule(e,t){const r=t==null?void 0:t.formSchemaUtils,a=r==null?void 0:r.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!a)return i;const s=this.getComponentContext(e);return s.componentClassList.forEach(d=>{if(!d||!a[d])return;const{canMove:c,canDelete:l,canAccept:o}=a[d];i.canMove=i.canMove&&this.resolveRuleValue(c,s),i.canDelete=i.canDelete&&this.resolveRuleValue(l,s),i.canAccept=i.canAccept&&this.resolveRuleValue(o,s)}),i}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const r=e.invalidContext||[];let a=!0;for(const i of r){if(i.firstLevelChild){if(i.firstLevelChild.class){const s=t.firstLevelChildClassList;if(s&&!s.includes(i.firstLevelChild.class)){a=!1;continue}}if(i.firstLevelChild.type){const s=t.firstLevelChildSchema;if(s&&s.type!==i.firstLevelChild.type){a=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const s=t.secondLevelChildClassList;if(s&&!s.includes(i.secondLevelChild.class)){a=!1;continue}}if(i.secondLevelChild.type){const s=t.secondLevelChildSchema;if(s&&s.type!==i.secondLevelChild.type){a=!1;continue}}}if(i.parent){if(i.parent.class){const s=t.parentClassList;if(s&&!s.includes(i.parent.class)){a=!1;continue}}if(i.parent.type){const s=t.parentSchema;if(s&&s.type!==i.parent.type){a=!1;continue}}}a=!0;break}return!a}getComponentContext(e){var u,b,g,y;const t=e.schema,r=t.appearance&&t.appearance.class||"",a=r.split(" ")||[],i=t.contents||[],s=i.length?i[0]:null,f=s&&s.appearance?s.appearance.class:"",d=f?f.split(" "):[],c=(u=s==null?void 0:s.contents)!=null&&u.length?s==null?void 0:s.contents[0]:null,l=c&&c.appearance?c.appearance.class:"",o=l?l.split(" "):[],p=t.type==="component"?(g=(b=e.parent)==null?void 0:b.parent)==null?void 0:g.schema:(y=e.parent)==null?void 0:y.schema,h=p&&p.appearance&&p.appearance.class||"",v=h?h.split(" "):[];return{componentClass:r,componentClassList:a,childContents:i,firstLevelChildSchema:s,firstLevelChildClass:f,firstLevelChildClassList:d,secondLevelChildSchema:c,secondLevelChildClass:l,secondLevelChildClassList:o,parentSchema:p,parentClass:h,parentClassList:v}}}class Fe{constructor(e,t){S(this,"componentId");S(this,"viewModelId");S(this,"eventsEditorUtils");S(this,"formSchemaUtils");S(this,"formMetadataConverter");S(this,"designViewModelUtils");S(this,"designViewModelField");S(this,"controlCreatorUtils");S(this,"designerHostService");S(this,"schemaService",null);S(this,"metadataService",null);S(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(a=>a.id===t)}e.updateOn=this.designViewModelField.updateOn}}changeFieldEditorType(e,t){}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:e.type,name:P[e.type].name}]}}}}}getAppearanceConfig(e=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(e,t){const r=t&&t.parent&&t.parent.schema;if(!r)return;const a=r.contents.findIndex(s=>s.id===e),i=I.cloneDeep(r.contents[a]);r.contents.splice(a,1),r.contents.splice(a,0,i)}}class Ae{constructor(){S(this,"label","");S(this,"id","");S(this,"columnInSM",12);S(this,"columnInMD",6);S(this,"columnInLG",3);S(this,"columnInEL",2);S(this,"displayWidthInSM",1);S(this,"displayWidthInMD",1);S(this,"displayWidthInLG",1);S(this,"displayWidthInEL",1);S(this,"displayColumnCountAtBreakPoint","md");S(this,"tagRow",0);S(this,"showTopBorder",0);S(this,"group",1);S(this,"isSupportedClass",!0);S(this,"fieldSetId","")}}function Ve(n){let e,t;const r=new Map;let a=[];function i(l,o){const h=l.split(" ").filter(y=>y.startsWith("col-"));if(h.length===0){o.isSupportedClass=!1;return}let v=h.find(y=>/^col-([1-9]|10|11|12)$/.test(y)),u=h.find(y=>/^col-md-([1-9]|10|11|12)$/.test(y)),b=h.find(y=>/^col-xl-([1-9]|10|11|12)$/.test(y)),g=h.find(y=>/^col-el-([1-9]|10|11|12)$/.test(y));v=v||"col-12",o.columnInSM=parseInt(v.replace("col-",""),10),o.displayWidthInSM=o.columnInSM/12,o.displayWidthInSM!==1&&(o.isSupportedClass=!1),u=u||"col-md-"+o.columnInSM,o.columnInMD=parseInt(u.replace("col-md-",""),10),o.displayWidthInMD=o.columnInMD/6,[1,2].includes(o.displayWidthInMD)||(o.isSupportedClass=!1),b=b||"col-xl-"+o.columnInMD,o.columnInLG=parseInt(b.replace("col-xl-",""),10),o.displayWidthInLG=o.columnInLG/3,[1,2,3,4].includes(o.displayWidthInLG)||(o.isSupportedClass=!1),g=g||"col-el-"+o.columnInLG,o.columnInEL=parseInt(g.replace("col-el-",""),10),o.displayWidthInEL=o.columnInEL/2,[1,2,3,4,5,6].includes(o.displayWidthInEL)||(o.isSupportedClass=!1)}function s(l,o,p,h=!1){let v=!1;l.contents.forEach(u=>{if(u.type==="fieldset"){p+=1,s(u,o,p,!0),v=!0;return}v&&(p+=1,v=!1);const b=u.appearance&&u.appearance.class,g=new Ae;b?i(b,g):g.isSupportedClass=!1,g.label=u.label||u.id,g.id=u.id,g.group=p,h&&(g.fieldSetId=l.id),t===u.id&&(e=p),r.set(u.id,u),o.push(g)})}function f(l){const o=n.getComponentById(l);if(!o||!o.componentType||!o.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const p=n.selectNode(o,h=>h.type===V.DgControl["response-form"].type);return!p||!p.contents||p.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:p}}function d(l,o){o=o||l.id;const{result:p,message:h,formNode:v}=f(o);if(!p)return{result:p,message:h};t=l.id,a=[],r.clear();const u=v.contents[0].type===V.DgControl.fieldset.type?0:1;s(v,a,u);const b=a.find(y=>!y.isSupportedClass);return{defaultState:{defaultGroupNumber:e||1,model:b?"customize":"standard"},importData:a}}function c(l,o){o=o;const{result:p,formNode:h}=f(o);if(!p)return"";const v=[];return l.forEach(u=>{var y;const b=r.get(u.id),g=b.appearance&&b.appearance.class;if(g){const T=g.split(" ").filter($e=>!$e.startsWith("col-")),C="col-"+u.columnInSM,D="col-md-"+u.columnInMD,w="col-xl-"+u.columnInLG,E="col-el-"+u.columnInEL,X=[C,D,w,E].concat(T);b.appearance.class=X.join(" ")}if(u.fieldSetId){const M=h.contents.find(C=>C.id===u.fieldSetId),T=v.find(C=>C.id===u.fieldSetId);T?(y=T.contents)==null||y.push(b):(v.push(M),M.contents=[b])}else v.push(b)}),h.contents=v,h.id}return{checkCanFindFormNode:f,checkCanOpenLayoutEditor:d,changeFormControlsByResponseLayoutConfig:c,getResonseFormLayoutConfig:s}}function Be(n,e){function t(d,c=null){if(c)return c;const l=n.getComponentById(e);return n.selectNode(l,o=>o.id===d)}function r(d){const c=n.getComponentById(d);return!(!c||!c.componentType||!c.componentType.startsWith("form"))}function a(d){const c=t(d.id),l=Ve(n),o=[];l.getResonseFormLayoutConfig(c,o,1);const p=o.map(T=>T.columnInSM),h=o.map(T=>T.columnInMD),v=o.map(T=>T.columnInLG),u=o.map(T=>T.columnInEL),b=i(p)?p[0]:0,g=i(h)?h[0]:0,y=i(v)?v[0]:0,M=i(u)?u[0]:0;return{uniqueColClassInSM:b,uniqueColClassInMD:g,uniqueColClassInLG:y,uniqueColClassInEL:M}}function i(d){const c=new Set(d);return Array.from(c).length===1}function s(d,c,l){d=t(l,d),d.contents.forEach(o=>{if(o.type===V.DgControl.fieldset.type){s(o,c,o.id);return}o.appearance||(o.appearance={});const p=o.appearance.class;o.appearance.class=f(p,c)})}function f(d,c){let l,o,p,h,v=[];if(d){const T=d.split(" "),C=T.filter(D=>D.startsWith("col-"));l=C.find(D=>/^col-([1-9]|10|11|12)$/.test(D)),o=C.find(D=>/^col-md-([1-9]|10|11|12)$/.test(D)),p=C.find(D=>/^col-xl-([1-9]|10|11|12)$/.test(D)),h=C.find(D=>/^col-el-([1-9]|10|11|12)$/.test(D)),v=T.filter(D=>!D.startsWith("col-"))}const u=c.uniqueColClassInSM?"col-"+c.uniqueColClassInSM:l,b=c.uniqueColClassInMD?"col-md-"+c.uniqueColClassInMD:o,g=c.uniqueColClassInLG?"col-xl-"+c.uniqueColClassInLG:p,y=c.uniqueColClassInEL?"col-el-"+c.uniqueColClassInEL:h;return[u,b,g,y].concat(v).join(" ")}return{checkIsInFormComponent:r,assembleUnifiedLayoutContext:a,changeFormControlsByUnifiedLayoutConfig:s}}class Ue extends Fe{constructor(e,t){super(e,t)}getPropertyConfig(e,t){var r=this;this.propertyConfig.categories.basic=this.getBasicPropConfig(e);const{checkIsInFormComponent:a,assembleUnifiedLayoutContext:i,changeFormControlsByUnifiedLayoutConfig:s}=Be(this.formSchemaUtils,this.componentId),f=this.getAppearanceConfig(e);return f.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",visible:a(this.componentId),refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:i(e)}},f.setPropertyRelates=function(d,c){if(d)switch(d&&d.propertyID){case"unifiedLayout":{s(null,d.propertyValue,e.id),r.updateElementByParentContainer(e.id,t);break}}},this.propertyConfig.categories.appearance=f,this.propertyConfig}}function _e(n,e){const t=n.schema,r=new ke,{canMove:a,canAccept:i,canDelete:s}=r.getTemplateRule(n,e);function f(y){const M=r.getComponentContext(n);return M&&M.componentClassList&&M.componentClassList.includes("f-form-layout")&&M.componentClassList.includes("farris-form")?y.sourceType==="control"&&y.controlCategory==="input"||y.sourceType==="move"&&y.controlType==="form-group":!0}function d(y){return!(!Pe().basalDragulaRuleForContainer(y,e)||!i||!f(y))}function c(y){m.nextTick()}function l(){return t.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function o(y,M){const T=t;if((T.appearance&&T.appearance.class||"").split(" ").includes("f-form-layout")){const{label:w}=y,E=G("form-group");return E.editor=M,E.label=w,p(E),delete E.editor.id,delete E.editor.binding,delete E.editor.appearance,delete E.editor.visible,E}return M}function p(y){const M=n.componentInstance.value.getBelongedComponentInstance(n.componentInstance);if(M&&M.schema&&M.schema.componentType){const T=M.schema.formColumns;let C=h(T);C=e==null?void 0:e.formSchemaUtils.getControlClassByFormUnifiedLayout(C,"",n.schema),y.appearance||(y.appearance={}),y.appearance.class=C}}function h(y){let M="";switch(y){case 1:{M="col-12";break}case 2:{M="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{M="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{M="col-12 col-md-6 col-xl-3 col-el-2";break}}return M}function v(){return a}function u(){return s}function b(){return!1}function g(y){return new Ue(y,e).getPropertyConfig(t,n.componentInstance.value)}return{canAccepts:d,checkCanDeleteComponent:u,checkCanMoveComponent:v,getStyles:l,getPropsConfig:g,hideNestedPaddingInDesginerView:b,onAcceptMovedChildElement:c,onResolveNewComponentSchema:o}}const je=m.defineComponent({name:"FNavDesign",props:F,emits:["nav"],setup(n,e){var v;const t=m.ref(n.activeNavId),r=m.ref(n.navData),a=m.ref(n.horizontal);m.ref(n.navPicking);const i=m.ref(),s=m.inject("design-item-context"),f=_e(s.schema,(v=s.parent)==null?void 0:v.schema),d=Ne(i,s,f);m.onMounted(()=>{i.value.componentInstance=d}),e.expose(d.value);const c=m.computed({get(){return r.value},set(u){r.value=u,p()}}),l=m.computed({get(){return t.value},set(u){if(t.value=u,t.value&&c&&c.value.length){const b=c.value.find(g=>g.id===t.value);b&&e.emit("nav",b)}}}),o=m.computed({set(u){a.value=u},get(){return a.value}});function p(){if(c.value&&c.value.length&&!t.value){const u=c.value.find(b=>!b.disable);u&&(t.value=u.id)}}function h(u){u.disable||u.id===t.value||(t.value=u.id,e.emit("nav",u))}return()=>{var u;return m.createVNode("div",{ref:i,class:["farris-nav",{"farris-nav-vertical":!o.value}]},[(u=c.value)==null?void 0:u.map(b=>m.createVNode("div",{class:["farris-nav-item",{active:b.id===l.value},{disabled:b.disable}],onClick:()=>h(b)},[m.createVNode("div",{class:"farris-nav-item-link"},[m.createVNode("span",{class:"farris-nav-item-link-text"},[b.text,b.num&&m.createVNode("div",{class:"farris-nav-item-tag"},[b.num<=n.maxNum&&m.createVNode("span",{class:"tag-text"},[b.num]),b.num>n.maxNum&&m.createVNode("span",{class:"tag-text"},[n.maxNum,m.createTextVNode("+")])])])])]))])}}}),Oe={install(n){n.component(A.name,A)},register(n,e,t,r){n.nav=A,e.nav=z},registerDesigner(n,e,t){n.nav=je,e.nav=z}};L.FNav=A,L.default=Oe,L.navProps=F,L.propsResolver=z,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var R = Object.defineProperty;
|
|
2
2
|
var P = (s, t, e) => t in s ? R(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
3
|
var C = (s, t, e) => P(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { defineComponent as x, ref as y, computed as r, watch as F, createVNode as
|
|
5
|
-
const
|
|
4
|
+
import { defineComponent as x, ref as y, computed as r, watch as F, createVNode as n, Fragment as S, reactive as E, createApp as _, onUnmounted as $, onMounted as H, Transition as j, mergeProps as M } from "vue";
|
|
5
|
+
const k = {
|
|
6
6
|
showCloseButton: { type: Boolean, default: !0 },
|
|
7
7
|
position: { type: String, default: "top-center" },
|
|
8
8
|
timeout: { type: Number, default: 3e3 },
|
|
@@ -14,21 +14,21 @@ const M = {
|
|
|
14
14
|
id: { type: String },
|
|
15
15
|
animate: { type: String, default: "fadeIn" },
|
|
16
16
|
options: { type: Object }
|
|
17
|
-
},
|
|
17
|
+
}, L = {
|
|
18
18
|
showCloseButton: { type: Boolean, default: !0 },
|
|
19
19
|
animate: { type: String, default: "fadeIn" },
|
|
20
20
|
options: { type: Object }
|
|
21
21
|
}, w = /* @__PURE__ */ x({
|
|
22
22
|
name: "Toast",
|
|
23
|
-
props:
|
|
23
|
+
props: L,
|
|
24
24
|
emits: ["close", "click"],
|
|
25
25
|
setup: (s, t) => {
|
|
26
|
-
const e = y(s.animate), a = "fadeOut", o = r(() => s.options),
|
|
26
|
+
const e = y(s.animate), a = "fadeOut", o = r(() => s.options), i = y(!1), u = r(() => {
|
|
27
27
|
const c = {
|
|
28
|
-
animated:
|
|
28
|
+
animated: i.value,
|
|
29
29
|
toast: !0
|
|
30
30
|
};
|
|
31
|
-
return c[s.animate] = !1, c[a] =
|
|
31
|
+
return c[s.animate] = !1, c[a] = i.value, c[o.value.type] = !0, o.value.theme && (c[o.value.theme] = !0), c;
|
|
32
32
|
}), l = r(() => {
|
|
33
33
|
const I = `f-icon-${o.value && o.value.type ? o.value.type.replace("toasty-type-", "") : "default"}`, O = {
|
|
34
34
|
"f-icon": !0
|
|
@@ -36,7 +36,7 @@ const M = {
|
|
|
36
36
|
return O[I] = !0, O;
|
|
37
37
|
}), p = r(() => o.value.title || o.value.message), f = r(() => o.value.title && o.value.message), m = r(() => !o.value.title && o.value.message), v = r(() => s.showCloseButton), d = r(() => !!o.value.buttons || !!t.slots.default);
|
|
38
38
|
function g(c) {
|
|
39
|
-
c.stopPropagation(), c.preventDefault(),
|
|
39
|
+
c.stopPropagation(), c.preventDefault(), i.value = !1, setTimeout(() => {
|
|
40
40
|
t.emit("close", o.value);
|
|
41
41
|
}, 200);
|
|
42
42
|
}
|
|
@@ -50,50 +50,50 @@ const M = {
|
|
|
50
50
|
});
|
|
51
51
|
const T = () => {
|
|
52
52
|
var c;
|
|
53
|
-
return
|
|
53
|
+
return n(S, null, [n("div", {
|
|
54
54
|
class: "after-toast-msg text-right"
|
|
55
|
-
}, [!t.slots.default && ((c = o.value.buttons) == null ? void 0 : c.map((b) =>
|
|
55
|
+
}, [!t.slots.default && ((c = o.value.buttons) == null ? void 0 : c.map((b) => n("span", {
|
|
56
56
|
class: B(b),
|
|
57
57
|
onClick: (I) => void 0
|
|
58
58
|
}, [b.text]))), t.slots.default && t.slots.default()])]);
|
|
59
59
|
};
|
|
60
|
-
return () =>
|
|
60
|
+
return () => n("div", {
|
|
61
61
|
class: u.value
|
|
62
|
-
}, [v.value &&
|
|
62
|
+
}, [v.value && n("button", {
|
|
63
63
|
title: "close",
|
|
64
64
|
class: "toast-close f-btn-icon f-bare",
|
|
65
65
|
onClick: g
|
|
66
|
-
}, [
|
|
66
|
+
}, [n("span", {
|
|
67
67
|
class: "f-icon modal_close"
|
|
68
|
-
}, null)]), p.value &&
|
|
68
|
+
}, null)]), p.value && n("section", {
|
|
69
69
|
class: "modal-tips"
|
|
70
|
-
}, [
|
|
70
|
+
}, [n("div", {
|
|
71
71
|
class: "float-left modal-tips-iconwrap"
|
|
72
|
-
}, [
|
|
72
|
+
}, [n("span", {
|
|
73
73
|
class: l.value
|
|
74
|
-
}, null)]),
|
|
74
|
+
}, null)]), n("div", {
|
|
75
75
|
class: "modal-tips-content"
|
|
76
|
-
}, [f.value &&
|
|
76
|
+
}, [f.value && n(S, null, [n("h5", {
|
|
77
77
|
class: "toast-title modal-tips-title",
|
|
78
78
|
innerHTML: o.value.title
|
|
79
|
-
}, null),
|
|
79
|
+
}, null), n("p", {
|
|
80
80
|
class: "toast-msg",
|
|
81
81
|
innerHTML: o.value.message
|
|
82
|
-
}, null), d.value && T()]), m.value && (o.value.buttons ?
|
|
82
|
+
}, null), d.value && T()]), m.value && (o.value.buttons ? n("div", {
|
|
83
83
|
class: "toast-title-btns-wrapper d-flex"
|
|
84
|
-
}, [
|
|
84
|
+
}, [n("h5", {
|
|
85
85
|
class: "toast-title modal-tips-title only-toast-msg",
|
|
86
86
|
innerHTML: o.value.message
|
|
87
|
-
}, null),
|
|
87
|
+
}, null), n("div", {
|
|
88
88
|
class: "after-toast-title text-right ml-auto"
|
|
89
|
-
}, [T()])]) :
|
|
89
|
+
}, [T()])]) : n("h5", {
|
|
90
90
|
class: "toast-title modal-tips-title only-toast-msg",
|
|
91
91
|
innerHTML: o.value.message
|
|
92
92
|
}, null))])])]);
|
|
93
93
|
}
|
|
94
94
|
}), N = /* @__PURE__ */ x({
|
|
95
95
|
name: "Notify",
|
|
96
|
-
props:
|
|
96
|
+
props: k,
|
|
97
97
|
emits: ["close", "empty"],
|
|
98
98
|
setup(s, t) {
|
|
99
99
|
const e = r(() => ({
|
|
@@ -103,7 +103,7 @@ const M = {
|
|
|
103
103
|
right: 12,
|
|
104
104
|
top: 20,
|
|
105
105
|
bottom: 12
|
|
106
|
-
}, o = y(),
|
|
106
|
+
}, o = y(), i = y(s.options), u = y(s.showCloseButton), l = r(() => s.position || "bottom-right"), p = r(() => s.timeout != null ? s.timeout : 3e3), f = r(() => {
|
|
107
107
|
const d = s.bottom ? s.bottom : a.bottom, g = s.top ? s.top : a.top, h = {
|
|
108
108
|
transition: "all 0.2s ease",
|
|
109
109
|
left: l.value.indexOf("left") > -1 ? `${s.left ? s.left : a.left}px` : "",
|
|
@@ -126,19 +126,19 @@ const M = {
|
|
|
126
126
|
function v(d, g) {
|
|
127
127
|
m();
|
|
128
128
|
}
|
|
129
|
-
return () =>
|
|
129
|
+
return () => n("div", {
|
|
130
130
|
class: e.value,
|
|
131
131
|
style: f.value,
|
|
132
132
|
ref: o
|
|
133
|
-
}, [
|
|
134
|
-
options:
|
|
133
|
+
}, [n(w, {
|
|
134
|
+
options: i.value,
|
|
135
135
|
showCloseButton: u.value,
|
|
136
136
|
animate: s.animate,
|
|
137
|
-
onClose: (d) => v(d,
|
|
137
|
+
onClose: (d) => v(d, i.value)
|
|
138
138
|
}, null)]);
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
|
-
class
|
|
141
|
+
class V {
|
|
142
142
|
constructor() {
|
|
143
143
|
C(this, "notifyRefs", []);
|
|
144
144
|
C(this, "globalConfig", E({}));
|
|
@@ -150,8 +150,8 @@ class L {
|
|
|
150
150
|
showCloseButton: !0
|
|
151
151
|
}, this.globalConfig, {
|
|
152
152
|
...t
|
|
153
|
-
}),
|
|
154
|
-
|
|
153
|
+
}), i = document.createElement("div");
|
|
154
|
+
i.style.display = "contents";
|
|
155
155
|
const u = _({
|
|
156
156
|
setup() {
|
|
157
157
|
const l = y();
|
|
@@ -168,17 +168,23 @@ class L {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
return $(() => {
|
|
171
|
-
document.body.removeChild(
|
|
171
|
+
document.body.removeChild(i);
|
|
172
172
|
}), H(() => {
|
|
173
173
|
e.updateNotifyPositionForCreate(o, l);
|
|
174
|
-
}), () =>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
174
|
+
}), () => n(j, {
|
|
175
|
+
mode: "out-in",
|
|
176
|
+
name: "fade",
|
|
177
|
+
appear: !0
|
|
178
|
+
}, {
|
|
179
|
+
default: () => [n(N, M({
|
|
180
|
+
ref: l
|
|
181
|
+
}, o, {
|
|
182
|
+
onClose: p
|
|
183
|
+
}), null)]
|
|
184
|
+
});
|
|
179
185
|
}
|
|
180
186
|
});
|
|
181
|
-
return u.provide("NotifyService", this), document.body.appendChild(
|
|
187
|
+
return u.provide("NotifyService", this), document.body.appendChild(i), u.mount(i), u;
|
|
182
188
|
}
|
|
183
189
|
getNotifyInstances(t) {
|
|
184
190
|
return this.notifyRefs.filter((e) => e.value.notifyPosition === t);
|
|
@@ -187,8 +193,8 @@ class L {
|
|
|
187
193
|
if (this.notifyRefs && this.notifyRefs.length) {
|
|
188
194
|
const a = window.innerHeight;
|
|
189
195
|
t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((o) => {
|
|
190
|
-
const
|
|
191
|
-
o.value.container.style.bottom =
|
|
196
|
+
const i = o.value.container.getBoundingClientRect();
|
|
197
|
+
o.value.container.style.bottom = i.height + a - i.bottom + "px";
|
|
192
198
|
});
|
|
193
199
|
}
|
|
194
200
|
this.notifyRefs = [...this.notifyRefs, e];
|
|
@@ -196,8 +202,8 @@ class L {
|
|
|
196
202
|
updateNotifyPositionForClose(t, e) {
|
|
197
203
|
const a = this.notifyRefs.indexOf(e);
|
|
198
204
|
if (t.position.indexOf("top") > -1) {
|
|
199
|
-
const o = this.getNotifyInstances(t.position),
|
|
200
|
-
o.slice(
|
|
205
|
+
const o = this.getNotifyInstances(t.position), i = o.indexOf(e);
|
|
206
|
+
o.slice(i + 1).forEach((u) => {
|
|
201
207
|
u.value.container.style.top = u.value.container.offsetTop - u.value.container.offsetHeight + "px";
|
|
202
208
|
});
|
|
203
209
|
}
|
|
@@ -207,8 +213,8 @@ class L {
|
|
|
207
213
|
return this.createNotifyInstance(t);
|
|
208
214
|
}
|
|
209
215
|
buildNotifyProps(t, e) {
|
|
210
|
-
let a = "", o = "",
|
|
211
|
-
typeof e == "string" ? a = e : e && (a = e.message || "", o = e.title || "", u = e.position || null, l = e.showCloseButton != null ? e.showCloseButton : null,
|
|
216
|
+
let a = "", o = "", i, u, l;
|
|
217
|
+
typeof e == "string" ? a = e : e && (a = e.message || "", o = e.title || "", u = e.position || null, l = e.showCloseButton != null ? e.showCloseButton : null, i = e.timeout != null ? e.timeout : null);
|
|
212
218
|
const f = {
|
|
213
219
|
options: {
|
|
214
220
|
type: t,
|
|
@@ -216,7 +222,7 @@ class L {
|
|
|
216
222
|
title: o
|
|
217
223
|
}
|
|
218
224
|
};
|
|
219
|
-
return u != null && (f.position = u), l != null && (f.showCloseButton = l),
|
|
225
|
+
return u != null && (f.position = u), l != null && (f.showCloseButton = l), i != null && (f.timeout = i), f;
|
|
220
226
|
}
|
|
221
227
|
info(t) {
|
|
222
228
|
const e = this.buildNotifyProps("info", t);
|
|
@@ -243,18 +249,18 @@ class L {
|
|
|
243
249
|
}), this.notifyRefs.length = 0;
|
|
244
250
|
}
|
|
245
251
|
}
|
|
246
|
-
const
|
|
252
|
+
const D = Symbol("NOTIFY_SERVICE_TOKEN");
|
|
247
253
|
N.install = (s) => {
|
|
248
254
|
s.component(N.name, N), s.component(w.name, w);
|
|
249
|
-
const t = new
|
|
250
|
-
s.provide(
|
|
255
|
+
const t = new V();
|
|
256
|
+
s.provide(D, t), s.provide("FNotifyService", t);
|
|
251
257
|
};
|
|
252
258
|
export {
|
|
253
259
|
N as FNotify,
|
|
254
|
-
|
|
260
|
+
V as FNotifyService,
|
|
255
261
|
w as FToast,
|
|
256
|
-
|
|
262
|
+
D as F_NOTIFY_SERVICE_TOKEN,
|
|
257
263
|
N as default,
|
|
258
|
-
|
|
259
|
-
|
|
264
|
+
k as notifyProps,
|
|
265
|
+
L as toastProps
|
|
260
266
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.notify={},l.Vue))})(this,function(l,t){"use strict";var F=Object.defineProperty;var P=(l,t,m)=>t in l?F(l,t,{enumerable:!0,configurable:!0,writable:!0,value:m}):l[t]=m;var w=(l,t,m)=>P(l,typeof t!="symbol"?t+"":t,m);const m={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object}},v={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},b=t.defineComponent({name:"Toast",props:v,emits:["close","click"],setup:(s,e)=>{const n=t.ref(s.animate),c="fadeOut",o=t.computed(()=>s.options),i=t.ref(!1),r=t.computed(()=>{const u={animated:i.value,toast:!0};return u[s.animate]=!1,u[c]=i.value,u[o.value.type]=!0,o.value.theme&&(u[o.value.theme]=!0),u}),a=t.computed(()=>{const V=`f-icon-${o.value&&o.value.type?o.value.type.replace("toasty-type-",""):"default"}`,B={"f-icon":!0};return B[V]=!0,B}),p=t.computed(()=>o.value.title||o.value.message),f=t.computed(()=>o.value.title&&o.value.message),d=t.computed(()=>!o.value.title&&o.value.message),g=t.computed(()=>s.showCloseButton),h=t.computed(()=>!!o.value.buttons||!!e.slots.default);function C(u){u.stopPropagation(),u.preventDefault(),i.value=!1,setTimeout(()=>{e.emit("close",o.value)},200)}function N(u,T){}function R(u){return`f-preten-link ${u.customClass?u.customClass:""}`}t.watch(n,()=>{n.value});const S=()=>{var u;return t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((u=o.value.buttons)==null?void 0:u.map(T=>t.createVNode("span",{class:R(T),onClick:V=>void 0},[T.text]))),e.slots.default&&e.slots.default()])])};return()=>t.createVNode("div",{class:r.value},[g.value&&t.createVNode("button",{title:"close",class:"toast-close f-btn-icon f-bare",onClick:C},[t.createVNode("span",{class:"f-icon modal_close"},null)]),p.value&&t.createVNode("section",{class:"modal-tips"},[t.createVNode("div",{class:"float-left modal-tips-iconwrap"},[t.createVNode("span",{class:a.value},null)]),t.createVNode("div",{class:"modal-tips-content"},[f.value&&t.createVNode(t.Fragment,null,[t.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:o.value.title},null),t.createVNode("p",{class:"toast-msg",innerHTML:o.value.message},null),h.value&&S()]),d.value&&(o.value.buttons?t.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null),t.createVNode("div",{class:"after-toast-title text-right ml-auto"},[S()])]):t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null))])])])}}),y=t.defineComponent({name:"Notify",props:m,emits:["close","empty"],setup(s,e){const n=t.computed(()=>({"farris-notify":!0})),c={left:12,right:12,top:20,bottom:12},o=t.ref(),i=t.ref(s.options),r=t.ref(s.showCloseButton),a=t.computed(()=>s.position||"bottom-right"),p=t.computed(()=>s.timeout!=null?s.timeout:3e3),f=t.computed(()=>{const h=s.bottom?s.bottom:c.bottom,C=s.top?s.top:c.top,N={transition:"all 0.2s ease",left:a.value.indexOf("left")>-1?`${s.left?s.left:c.left}px`:"",right:a.value.indexOf("right")>-1?`${s.right?s.right:c.right}px`:"",top:a.value.indexOf("top")>-1?`${C}px`:"",bottom:a.value.indexOf("bottom")>-1?`${h}px`:""};return a.value.indexOf("center")>-1&&(N.left="50%",N.marginLeft="calc(-24rem / 2)",a.value==="center-center"&&(N.top="50%",N.transform="translate(-50%, -50%)")),N});function d(h){e.emit("close")}p.value&&setTimeout(()=>{d()},p.value),e.expose({closeToast:d,container:o,notifyPosition:a});function g(h,C){d()}return()=>t.createVNode("div",{class:n.value,style:f.value,ref:o},[t.createVNode(b,{options:i.value,showCloseButton:r.value,animate:s.animate,onClose:h=>g(h,i.value)},null)])}});class I{constructor(){w(this,"notifyRefs",[]);w(this,"globalConfig",t.reactive({}))}createNotifyInstance(e){const n=this,o=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0},this.globalConfig,{...e}),i=document.createElement("div");i.style.display="contents";const r=t.createApp({setup(){const a=t.ref();function p(){a.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(o,a),r.unmount()},220)}if(o.position.indexOf("top")>-1){const f=n.getNotifyInstances(o.position),d=f[f.length-1];if(d){const g=d.value.container.getBoundingClientRect();o.top=g.bottom}}return t.onUnmounted(()=>{document.body.removeChild(i)}),t.onMounted(()=>{n.updateNotifyPositionForCreate(o,a)}),()=>t.createVNode(y,t.mergeProps({ref:a},o,{onClose:p}),null)}});return r.provide("NotifyService",this),document.body.appendChild(i),r.mount(i),r}getNotifyInstances(e){return this.notifyRefs.filter(n=>n.value.notifyPosition===e)}updateNotifyPositionForCreate(e,n){if(this.notifyRefs&&this.notifyRefs.length){const c=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(o=>{const i=o.value.container.getBoundingClientRect();o.value.container.style.bottom=i.height+c-i.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,n]}updateNotifyPositionForClose(e,n){const c=this.notifyRefs.indexOf(n);if(e.position.indexOf("top")>-1){const o=this.getNotifyInstances(e.position),i=o.indexOf(n);o.slice(i+1).forEach(r=>{r.value.container.style.top=r.value.container.offsetTop-r.value.container.offsetHeight+"px"})}c>-1&&this.notifyRefs.splice(c,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,n){let c="",o="",i,r,a;typeof n=="string"?c=n:n&&(c=n.message||"",o=n.title||"",r=n.position||null,a=n.showCloseButton!=null?n.showCloseButton:null,i=n.timeout!=null?n.timeout:null);const f={options:{type:e,message:c,title:o}};return r!=null&&(f.position=r),a!=null&&(f.showCloseButton=a),i!=null&&(f.timeout=i),f}info(e){const n=this.buildNotifyProps("info",e);return this.show(n)}success(e){const n=this.buildNotifyProps("success",e);return this.show(n)}warning(e){const n=this.buildNotifyProps("warning",e);return this.show(n)}error(e){const n=this.buildNotifyProps("error",e);return this.show(n)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const O=Symbol("NOTIFY_SERVICE_TOKEN");y.install=s=>{s.component(y.name,y),s.component(b.name,b);const e=new I;s.provide(O,e),s.provide("FNotifyService",e)},l.FNotify=y,l.FNotifyService=I,l.FToast=b,l.F_NOTIFY_SERVICE_TOKEN=O,l.default=y,l.notifyProps=m,l.toastProps=v,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.notify={},l.Vue))})(this,function(l,t){"use strict";var F=Object.defineProperty;var P=(l,t,m)=>t in l?F(l,t,{enumerable:!0,configurable:!0,writable:!0,value:m}):l[t]=m;var w=(l,t,m)=>P(l,typeof t!="symbol"?t+"":t,m);const m={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object}},v={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},b=t.defineComponent({name:"Toast",props:v,emits:["close","click"],setup:(s,e)=>{const n=t.ref(s.animate),c="fadeOut",o=t.computed(()=>s.options),i=t.ref(!1),r=t.computed(()=>{const u={animated:i.value,toast:!0};return u[s.animate]=!1,u[c]=i.value,u[o.value.type]=!0,o.value.theme&&(u[o.value.theme]=!0),u}),a=t.computed(()=>{const V=`f-icon-${o.value&&o.value.type?o.value.type.replace("toasty-type-",""):"default"}`,B={"f-icon":!0};return B[V]=!0,B}),p=t.computed(()=>o.value.title||o.value.message),f=t.computed(()=>o.value.title&&o.value.message),d=t.computed(()=>!o.value.title&&o.value.message),g=t.computed(()=>s.showCloseButton),h=t.computed(()=>!!o.value.buttons||!!e.slots.default);function C(u){u.stopPropagation(),u.preventDefault(),i.value=!1,setTimeout(()=>{e.emit("close",o.value)},200)}function N(u,T){}function R(u){return`f-preten-link ${u.customClass?u.customClass:""}`}t.watch(n,()=>{n.value});const S=()=>{var u;return t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"after-toast-msg text-right"},[!e.slots.default&&((u=o.value.buttons)==null?void 0:u.map(T=>t.createVNode("span",{class:R(T),onClick:V=>void 0},[T.text]))),e.slots.default&&e.slots.default()])])};return()=>t.createVNode("div",{class:r.value},[g.value&&t.createVNode("button",{title:"close",class:"toast-close f-btn-icon f-bare",onClick:C},[t.createVNode("span",{class:"f-icon modal_close"},null)]),p.value&&t.createVNode("section",{class:"modal-tips"},[t.createVNode("div",{class:"float-left modal-tips-iconwrap"},[t.createVNode("span",{class:a.value},null)]),t.createVNode("div",{class:"modal-tips-content"},[f.value&&t.createVNode(t.Fragment,null,[t.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:o.value.title},null),t.createVNode("p",{class:"toast-msg",innerHTML:o.value.message},null),h.value&&S()]),d.value&&(o.value.buttons?t.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null),t.createVNode("div",{class:"after-toast-title text-right ml-auto"},[S()])]):t.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:o.value.message},null))])])])}}),y=t.defineComponent({name:"Notify",props:m,emits:["close","empty"],setup(s,e){const n=t.computed(()=>({"farris-notify":!0})),c={left:12,right:12,top:20,bottom:12},o=t.ref(),i=t.ref(s.options),r=t.ref(s.showCloseButton),a=t.computed(()=>s.position||"bottom-right"),p=t.computed(()=>s.timeout!=null?s.timeout:3e3),f=t.computed(()=>{const h=s.bottom?s.bottom:c.bottom,C=s.top?s.top:c.top,N={transition:"all 0.2s ease",left:a.value.indexOf("left")>-1?`${s.left?s.left:c.left}px`:"",right:a.value.indexOf("right")>-1?`${s.right?s.right:c.right}px`:"",top:a.value.indexOf("top")>-1?`${C}px`:"",bottom:a.value.indexOf("bottom")>-1?`${h}px`:""};return a.value.indexOf("center")>-1&&(N.left="50%",N.marginLeft="calc(-24rem / 2)",a.value==="center-center"&&(N.top="50%",N.transform="translate(-50%, -50%)")),N});function d(h){e.emit("close")}p.value&&setTimeout(()=>{d()},p.value),e.expose({closeToast:d,container:o,notifyPosition:a});function g(h,C){d()}return()=>t.createVNode("div",{class:n.value,style:f.value,ref:o},[t.createVNode(b,{options:i.value,showCloseButton:r.value,animate:s.animate,onClose:h=>g(h,i.value)},null)])}});class I{constructor(){w(this,"notifyRefs",[]);w(this,"globalConfig",t.reactive({}))}createNotifyInstance(e){const n=this,o=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0},this.globalConfig,{...e}),i=document.createElement("div");i.style.display="contents";const r=t.createApp({setup(){const a=t.ref();function p(){a.value.container.style.transform="scale(0)",setTimeout(()=>{n.updateNotifyPositionForClose(o,a),r.unmount()},220)}if(o.position.indexOf("top")>-1){const f=n.getNotifyInstances(o.position),d=f[f.length-1];if(d){const g=d.value.container.getBoundingClientRect();o.top=g.bottom}}return t.onUnmounted(()=>{document.body.removeChild(i)}),t.onMounted(()=>{n.updateNotifyPositionForCreate(o,a)}),()=>t.createVNode(t.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[t.createVNode(y,t.mergeProps({ref:a},o,{onClose:p}),null)]})}});return r.provide("NotifyService",this),document.body.appendChild(i),r.mount(i),r}getNotifyInstances(e){return this.notifyRefs.filter(n=>n.value.notifyPosition===e)}updateNotifyPositionForCreate(e,n){if(this.notifyRefs&&this.notifyRefs.length){const c=window.innerHeight;e.position.indexOf("bottom")>-1&&this.getNotifyInstances(e.position).forEach(o=>{const i=o.value.container.getBoundingClientRect();o.value.container.style.bottom=i.height+c-i.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,n]}updateNotifyPositionForClose(e,n){const c=this.notifyRefs.indexOf(n);if(e.position.indexOf("top")>-1){const o=this.getNotifyInstances(e.position),i=o.indexOf(n);o.slice(i+1).forEach(r=>{r.value.container.style.top=r.value.container.offsetTop-r.value.container.offsetHeight+"px"})}c>-1&&this.notifyRefs.splice(c,1)}show(e){return this.createNotifyInstance(e)}buildNotifyProps(e,n){let c="",o="",i,r,a;typeof n=="string"?c=n:n&&(c=n.message||"",o=n.title||"",r=n.position||null,a=n.showCloseButton!=null?n.showCloseButton:null,i=n.timeout!=null?n.timeout:null);const f={options:{type:e,message:c,title:o}};return r!=null&&(f.position=r),a!=null&&(f.showCloseButton=a),i!=null&&(f.timeout=i),f}info(e){const n=this.buildNotifyProps("info",e);return this.show(n)}success(e){const n=this.buildNotifyProps("success",e);return this.show(n)}warning(e){const n=this.buildNotifyProps("warning",e);return this.show(n)}error(e){const n=this.buildNotifyProps("error",e);return this.show(n)}close(e){e&&e.unmount()}closeAll(){this.notifyRefs.forEach(e=>{e==null||e.value.closeToast()}),this.notifyRefs.length=0}}const O=Symbol("NOTIFY_SERVICE_TOKEN");y.install=s=>{s.component(y.name,y),s.component(b.name,b);const e=new I;s.provide(O,e),s.provide("FNotifyService",e)},l.FNotify=y,l.FNotifyService=I,l.FToast=b,l.F_NOTIFY_SERVICE_TOKEN=O,l.default=y,l.notifyProps=m,l.toastProps=v,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|